{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Pandas\n",
    "\n",
    "Pandas is seriously a game changer when it comes to cleaning, transforming, manipulating and analyzing data. In simple terms, Pandas helps to clean the mess."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Loading Data\n",
    "Reading different types of tabulated files "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   #                   Name Type 1  Type 2  HP  Attack  Defense  Sp. Atk  \\\n0  1              Bulbasaur  Grass  Poison  45      49       49       65   \n1  2                Ivysaur  Grass  Poison  60      62       63       80   \n2  3               Venusaur  Grass  Poison  80      82       83      100   \n3  3  VenusaurMega Venusaur  Grass  Poison  80     100      123      122   \n4  4             Charmander   Fire     NaN  39      52       43       60   \n\n   Sp. Def  Speed  Generation  Legendary  \n0       65     45           1      False  \n1       80     60           1      False  \n2      100     80           1      False  \n3      120     80           1      False  \n4       50     65           1      False  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>#</th>\n      <th>Name</th>\n      <th>Type 1</th>\n      <th>Type 2</th>\n      <th>HP</th>\n      <th>Attack</th>\n      <th>Defense</th>\n      <th>Sp. Atk</th>\n      <th>Sp. Def</th>\n      <th>Speed</th>\n      <th>Generation</th>\n      <th>Legendary</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>Bulbasaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>45</td>\n      <td>49</td>\n      <td>49</td>\n      <td>65</td>\n      <td>65</td>\n      <td>45</td>\n      <td>1</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>Ivysaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>60</td>\n      <td>62</td>\n      <td>63</td>\n      <td>80</td>\n      <td>80</td>\n      <td>60</td>\n      <td>1</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>Venusaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>80</td>\n      <td>82</td>\n      <td>83</td>\n      <td>100</td>\n      <td>100</td>\n      <td>80</td>\n      <td>1</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>3</td>\n      <td>VenusaurMega Venusaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>80</td>\n      <td>100</td>\n      <td>123</td>\n      <td>122</td>\n      <td>120</td>\n      <td>80</td>\n      <td>1</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>4</td>\n      <td>Charmander</td>\n      <td>Fire</td>\n      <td>NaN</td>\n      <td>39</td>\n      <td>52</td>\n      <td>43</td>\n      <td>60</td>\n      <td>50</td>\n      <td>65</td>\n      <td>1</td>\n      <td>False</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 1
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "df = pd.read_csv('pokemon_data.csv')\n",
    "df.head()\n",
    "#df_xlsx = pd.read_excel('pokemon_data.xlsx')\n",
    "#print(df_xlsx.head(3))\n",
    "\n",
    "#df = pd.read_csv('pokemon_data.txt', delimiter='\\t')\n",
    "#print(df)\n",
    "\n",
    "#df['HP'] #select a series/column from a dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "                   City Colors Reported Shape Reported State             Time\n0                Ithaca             NaN       TRIANGLE    NY   6/1/1930 22:00\n1           Willingboro             NaN          OTHER    NJ  6/30/1930 20:00\n2               Holyoke             NaN           OVAL    CO  2/15/1931 14:00\n3               Abilene             NaN           DISK    KS   6/1/1931 13:00\n4  New York Worlds Fair             NaN          LIGHT    NY  4/18/1933 19:00",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>City</th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>State</th>\n      <th>Time</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Ithaca</td>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>NY</td>\n      <td>6/1/1930 22:00</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Willingboro</td>\n      <td>NaN</td>\n      <td>OTHER</td>\n      <td>NJ</td>\n      <td>6/30/1930 20:00</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Holyoke</td>\n      <td>NaN</td>\n      <td>OVAL</td>\n      <td>CO</td>\n      <td>2/15/1931 14:00</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>Abilene</td>\n      <td>NaN</td>\n      <td>DISK</td>\n      <td>KS</td>\n      <td>6/1/1931 13:00</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>New York Worlds Fair</td>\n      <td>NaN</td>\n      <td>LIGHT</td>\n      <td>NY</td>\n      <td>4/18/1933 19:00</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 2
    }
   ],
   "source": [
    "ufo = pd.read_csv('ufo-sightings.csv')\n",
    "ufo.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   star_rating                     title content_rating   genre  duration  \\\n0          9.3  The Shawshank Redemption              R   Crime       142   \n1          9.2             The Godfather              R   Crime       175   \n2          9.1    The Godfather: Part II              R   Crime       200   \n3          9.0           The Dark Knight          PG-13  Action       152   \n4          8.9              Pulp Fiction              R   Crime       154   \n\n                                         actors_list  \n0  [u&#39;Tim Robbins&#39;, u&#39;Morgan Freeman&#39;, u&#39;Bob Gunt...  \n1    [u&#39;Marlon Brando&#39;, u&#39;Al Pacino&#39;, u&#39;James Caan&#39;]  \n2  [u&#39;Al Pacino&#39;, u&#39;Robert De Niro&#39;, u&#39;Robert Duv...  \n3  [u&#39;Christian Bale&#39;, u&#39;Heath Ledger&#39;, u&#39;Aaron E...  \n4  [u&#39;John Travolta&#39;, u&#39;Uma Thurman&#39;, u&#39;Samuel L....  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>star_rating</th>\n      <th>title</th>\n      <th>content_rating</th>\n      <th>genre</th>\n      <th>duration</th>\n      <th>actors_list</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>9.3</td>\n      <td>The Shawshank Redemption</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>142</td>\n      <td>[u'Tim Robbins', u'Morgan Freeman', u'Bob Gunt...</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>9.2</td>\n      <td>The Godfather</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>175</td>\n      <td>[u'Marlon Brando', u'Al Pacino', u'James Caan']</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>9.1</td>\n      <td>The Godfather: Part II</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>200</td>\n      <td>[u'Al Pacino', u'Robert De Niro', u'Robert Duv...</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>9.0</td>\n      <td>The Dark Knight</td>\n      <td>PG-13</td>\n      <td>Action</td>\n      <td>152</td>\n      <td>[u'Christian Bale', u'Heath Ledger', u'Aaron E...</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>8.9</td>\n      <td>Pulp Fiction</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>154</td>\n      <td>[u'John Travolta', u'Uma Thurman', u'Samuel L....</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 3
    }
   ],
   "source": [
    "movies = pd.read_csv('http://bit.ly/imdbratings')\n",
    "movies.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   order_id  quantity                              item_name  \\\n0         1         1           Chips and Fresh Tomato Salsa   \n1         1         1                                   Izze   \n2         1         1                       Nantucket Nectar   \n3         1         1  Chips and Tomatillo-Green Chili Salsa   \n4         2         2                           Chicken Bowl   \n\n                                  choice_description item_price  \n0                                                NaN     $2.39   \n1                                       [Clementine]     $3.39   \n2                                            [Apple]     $3.39   \n3                                                NaN     $2.39   \n4  [Tomatillo-Red Chili Salsa (Hot), [Black Beans...    $16.98   ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>order_id</th>\n      <th>quantity</th>\n      <th>item_name</th>\n      <th>choice_description</th>\n      <th>item_price</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>1</td>\n      <td>Chips and Fresh Tomato Salsa</td>\n      <td>NaN</td>\n      <td>$2.39</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1</td>\n      <td>1</td>\n      <td>Izze</td>\n      <td>[Clementine]</td>\n      <td>$3.39</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1</td>\n      <td>1</td>\n      <td>Nantucket Nectar</td>\n      <td>[Apple]</td>\n      <td>$3.39</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1</td>\n      <td>1</td>\n      <td>Chips and Tomatillo-Green Chili Salsa</td>\n      <td>NaN</td>\n      <td>$2.39</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>2</td>\n      <td>2</td>\n      <td>Chicken Bowl</td>\n      <td>[Tomatillo-Red Chili Salsa (Hot), [Black Beans...</td>\n      <td>$16.98</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 4
    }
   ],
   "source": [
    "orders = pd.read_table('http://bit.ly/chiporders')\n",
    "orders.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "       country  beer_servings  spirit_servings  wine_servings  \\\n0  Afghanistan              0                0              0   \n1      Albania             89              132             54   \n2      Algeria             25                0             14   \n3      Andorra            245              138            312   \n4       Angola            217               57             45   \n\n   total_litres_of_pure_alcohol continent  \n0                           0.0      Asia  \n1                           4.9    Europe  \n2                           0.7    Africa  \n3                          12.4    Europe  \n4                           5.9    Africa  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>country</th>\n      <th>beer_servings</th>\n      <th>spirit_servings</th>\n      <th>wine_servings</th>\n      <th>total_litres_of_pure_alcohol</th>\n      <th>continent</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Afghanistan</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0.0</td>\n      <td>Asia</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Albania</td>\n      <td>89</td>\n      <td>132</td>\n      <td>54</td>\n      <td>4.9</td>\n      <td>Europe</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Algeria</td>\n      <td>25</td>\n      <td>0</td>\n      <td>14</td>\n      <td>0.7</td>\n      <td>Africa</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>Andorra</td>\n      <td>245</td>\n      <td>138</td>\n      <td>312</td>\n      <td>12.4</td>\n      <td>Europe</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>Angola</td>\n      <td>217</td>\n      <td>57</td>\n      <td>45</td>\n      <td>5.9</td>\n      <td>Africa</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 5
    }
   ],
   "source": [
    "drinks = pd.read_csv('http://bit.ly/drinksbycountry')\n",
    "drinks.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Data Assesment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   star_rating                     title content_rating   genre  duration  \\\n0          9.3  The Shawshank Redemption              R   Crime       142   \n1          9.2             The Godfather              R   Crime       175   \n2          9.1    The Godfather: Part II              R   Crime       200   \n3          9.0           The Dark Knight          PG-13  Action       152   \n4          8.9              Pulp Fiction              R   Crime       154   \n\n                                         actors_list  \n0  [u&#39;Tim Robbins&#39;, u&#39;Morgan Freeman&#39;, u&#39;Bob Gunt...  \n1    [u&#39;Marlon Brando&#39;, u&#39;Al Pacino&#39;, u&#39;James Caan&#39;]  \n2  [u&#39;Al Pacino&#39;, u&#39;Robert De Niro&#39;, u&#39;Robert Duv...  \n3  [u&#39;Christian Bale&#39;, u&#39;Heath Ledger&#39;, u&#39;Aaron E...  \n4  [u&#39;John Travolta&#39;, u&#39;Uma Thurman&#39;, u&#39;Samuel L....  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>star_rating</th>\n      <th>title</th>\n      <th>content_rating</th>\n      <th>genre</th>\n      <th>duration</th>\n      <th>actors_list</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>9.3</td>\n      <td>The Shawshank Redemption</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>142</td>\n      <td>[u'Tim Robbins', u'Morgan Freeman', u'Bob Gunt...</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>9.2</td>\n      <td>The Godfather</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>175</td>\n      <td>[u'Marlon Brando', u'Al Pacino', u'James Caan']</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>9.1</td>\n      <td>The Godfather: Part II</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>200</td>\n      <td>[u'Al Pacino', u'Robert De Niro', u'Robert Duv...</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>9.0</td>\n      <td>The Dark Knight</td>\n      <td>PG-13</td>\n      <td>Action</td>\n      <td>152</td>\n      <td>[u'Christian Bale', u'Heath Ledger', u'Aaron E...</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>8.9</td>\n      <td>Pulp Fiction</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>154</td>\n      <td>[u'John Travolta', u'Uma Thurman', u'Samuel L....</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 7
    }
   ],
   "source": [
    "movies.head() # examine the first 5 rows"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "              City Colors Reported Shape Reported State              Time\n18236   Grant Park             NaN       TRIANGLE    IL  12/31/2000 23:00\n18237  Spirit Lake             NaN           DISK    IA  12/31/2000 23:00\n18238  Eagle River             NaN            NaN    WI  12/31/2000 23:45\n18239  Eagle River             RED          LIGHT    WI  12/31/2000 23:45\n18240         Ybor             NaN           OVAL    FL  12/31/2000 23:59",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>City</th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>State</th>\n      <th>Time</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>18236</th>\n      <td>Grant Park</td>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>IL</td>\n      <td>12/31/2000 23:00</td>\n    </tr>\n    <tr>\n      <th>18237</th>\n      <td>Spirit Lake</td>\n      <td>NaN</td>\n      <td>DISK</td>\n      <td>IA</td>\n      <td>12/31/2000 23:00</td>\n    </tr>\n    <tr>\n      <th>18238</th>\n      <td>Eagle River</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>WI</td>\n      <td>12/31/2000 23:45</td>\n    </tr>\n    <tr>\n      <th>18239</th>\n      <td>Eagle River</td>\n      <td>RED</td>\n      <td>LIGHT</td>\n      <td>WI</td>\n      <td>12/31/2000 23:45</td>\n    </tr>\n    <tr>\n      <th>18240</th>\n      <td>Ybor</td>\n      <td>NaN</td>\n      <td>OVAL</td>\n      <td>FL</td>\n      <td>12/31/2000 23:59</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 8
    }
   ],
   "source": [
    "ufo.tail() # examine the last 5 rows"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "(800, 12)"
     },
     "metadata": {},
     "execution_count": 9
    }
   ],
   "source": [
    "df.shape   # Shape of the dataset as matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": "&lt;class &#39;pandas.core.frame.DataFrame&#39;&gt;\nRangeIndex: 18241 entries, 0 to 18240\nData columns (total 5 columns):\n #   Column           Non-Null Count  Dtype \n---  ------           --------------  ----- \n 0   City             18216 non-null  object\n 1   Colors Reported  2882 non-null   object\n 2   Shape Reported   15597 non-null  object\n 3   State            18241 non-null  object\n 4   Time             18241 non-null  object\ndtypes: object(5)\nmemory usage: 712.7+ KB\n"
    }
   ],
   "source": [
    "ufo.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "star_rating       float64\ntitle              object\ncontent_rating     object\ngenre              object\nduration            int64\nactors_list        object\ndtype: object"
     },
     "metadata": {},
     "execution_count": 11
    }
   ],
   "source": [
    "movies.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "                 #     Name Type 1  Type 2          HP      Attack  \\\ncount   800.000000      800    800     414  800.000000  800.000000   \nunique         NaN      800     18      18         NaN         NaN   \ntop            NaN  Psyduck  Water  Flying         NaN         NaN   \nfreq           NaN        1    112      97         NaN         NaN   \nmean    362.813750      NaN    NaN     NaN   69.258750   79.001250   \nstd     208.343798      NaN    NaN     NaN   25.534669   32.457366   \nmin       1.000000      NaN    NaN     NaN    1.000000    5.000000   \n25%     184.750000      NaN    NaN     NaN   50.000000   55.000000   \n50%     364.500000      NaN    NaN     NaN   65.000000   75.000000   \n75%     539.250000      NaN    NaN     NaN   80.000000  100.000000   \nmax     721.000000      NaN    NaN     NaN  255.000000  190.000000   \n\n           Defense     Sp. Atk     Sp. Def       Speed  Generation Legendary  \ncount   800.000000  800.000000  800.000000  800.000000   800.00000       800  \nunique         NaN         NaN         NaN         NaN         NaN         2  \ntop            NaN         NaN         NaN         NaN         NaN     False  \nfreq           NaN         NaN         NaN         NaN         NaN       735  \nmean     73.842500   72.820000   71.902500   68.277500     3.32375       NaN  \nstd      31.183501   32.722294   27.828916   29.060474     1.66129       NaN  \nmin       5.000000   10.000000   20.000000    5.000000     1.00000       NaN  \n25%      50.000000   49.750000   50.000000   45.000000     2.00000       NaN  \n50%      70.000000   65.000000   70.000000   65.000000     3.00000       NaN  \n75%      90.000000   95.000000   90.000000   90.000000     5.00000       NaN  \nmax     230.000000  194.000000  230.000000  180.000000     6.00000       NaN  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>#</th>\n      <th>Name</th>\n      <th>Type 1</th>\n      <th>Type 2</th>\n      <th>HP</th>\n      <th>Attack</th>\n      <th>Defense</th>\n      <th>Sp. Atk</th>\n      <th>Sp. Def</th>\n      <th>Speed</th>\n      <th>Generation</th>\n      <th>Legendary</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>count</th>\n      <td>800.000000</td>\n      <td>800</td>\n      <td>800</td>\n      <td>414</td>\n      <td>800.000000</td>\n      <td>800.000000</td>\n      <td>800.000000</td>\n      <td>800.000000</td>\n      <td>800.000000</td>\n      <td>800.000000</td>\n      <td>800.00000</td>\n      <td>800</td>\n    </tr>\n    <tr>\n      <th>unique</th>\n      <td>NaN</td>\n      <td>800</td>\n      <td>18</td>\n      <td>18</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>top</th>\n      <td>NaN</td>\n      <td>Psyduck</td>\n      <td>Water</td>\n      <td>Flying</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>freq</th>\n      <td>NaN</td>\n      <td>1</td>\n      <td>112</td>\n      <td>97</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>735</td>\n    </tr>\n    <tr>\n      <th>mean</th>\n      <td>362.813750</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>69.258750</td>\n      <td>79.001250</td>\n      <td>73.842500</td>\n      <td>72.820000</td>\n      <td>71.902500</td>\n      <td>68.277500</td>\n      <td>3.32375</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>std</th>\n      <td>208.343798</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>25.534669</td>\n      <td>32.457366</td>\n      <td>31.183501</td>\n      <td>32.722294</td>\n      <td>27.828916</td>\n      <td>29.060474</td>\n      <td>1.66129</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>min</th>\n      <td>1.000000</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>1.000000</td>\n      <td>5.000000</td>\n      <td>5.000000</td>\n      <td>10.000000</td>\n      <td>20.000000</td>\n      <td>5.000000</td>\n      <td>1.00000</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>25%</th>\n      <td>184.750000</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>50.000000</td>\n      <td>55.000000</td>\n      <td>50.000000</td>\n      <td>49.750000</td>\n      <td>50.000000</td>\n      <td>45.000000</td>\n      <td>2.00000</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>50%</th>\n      <td>364.500000</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>65.000000</td>\n      <td>75.000000</td>\n      <td>70.000000</td>\n      <td>65.000000</td>\n      <td>70.000000</td>\n      <td>65.000000</td>\n      <td>3.00000</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>75%</th>\n      <td>539.250000</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>80.000000</td>\n      <td>100.000000</td>\n      <td>90.000000</td>\n      <td>95.000000</td>\n      <td>90.000000</td>\n      <td>90.000000</td>\n      <td>5.00000</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>max</th>\n      <td>721.000000</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>255.000000</td>\n      <td>190.000000</td>\n      <td>230.000000</td>\n      <td>194.000000</td>\n      <td>230.000000</td>\n      <td>180.000000</td>\n      <td>6.00000</td>\n      <td>NaN</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 12
    }
   ],
   "source": [
    "df.describe(include='all')     #calculate summary statistics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "Index([&#39;City&#39;, &#39;Colors Reported&#39;, &#39;Shape Reported&#39;, &#39;State&#39;, &#39;Time&#39;], dtype=&#39;object&#39;)"
     },
     "metadata": {},
     "execution_count": 13
    }
   ],
   "source": [
    "ufo.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "0                      Ithaca\n1                 Willingboro\n2                     Holyoke\n3                     Abilene\n4        New York Worlds Fair\n                 ...         \n18236              Grant Park\n18237             Spirit Lake\n18238             Eagle River\n18239             Eagle River\n18240                    Ybor\nName: City, Length: 18241, dtype: object"
     },
     "metadata": {},
     "execution_count": 14
    }
   ],
   "source": [
    "ufo['City']        # select the 'City' Series using bracket notation\n",
    "#ufo.City          # or equivalently, use dot notation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "16"
     },
     "metadata": {},
     "execution_count": 15
    }
   ],
   "source": [
    "movies.genre.nunique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "array([&#39;Crime&#39;, &#39;Action&#39;, &#39;Drama&#39;, &#39;Western&#39;, &#39;Adventure&#39;, &#39;Biography&#39;,\n       &#39;Comedy&#39;, &#39;Animation&#39;, &#39;Mystery&#39;, &#39;Horror&#39;, &#39;Film-Noir&#39;, &#39;Sci-Fi&#39;,\n       &#39;History&#39;, &#39;Thriller&#39;, &#39;Family&#39;, &#39;Fantasy&#39;], dtype=object)"
     },
     "metadata": {},
     "execution_count": 16
    }
   ],
   "source": [
    "movies.genre.unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "# loc  - [index/bool,'column names']\n",
    "# iloc - [index/bool,index position]  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The [**`loc`**](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.loc.html) method is used to select rows and columns by **label / name**. You can pass it:\n",
    "\n",
    "- A single label\n",
    "- A list of labels\n",
    "- A slice of labels\n",
    "- A boolean Series\n",
    "- A colon (which indicates \"all labels\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "City                   Willingboro\nColors Reported                NaN\nShape Reported               OTHER\nState                           NJ\nTime               6/30/1930 20:00\nName: 1, dtype: object"
     },
     "metadata": {},
     "execution_count": 18
    }
   ],
   "source": [
    "# row 0, all columns\n",
    "ufo.loc[1, :]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "          City Colors Reported Shape Reported State             Time\n0       Ithaca             NaN       TRIANGLE    NY   6/1/1930 22:00\n1  Willingboro             NaN          OTHER    NJ  6/30/1930 20:00\n2      Holyoke             NaN           OVAL    CO  2/15/1931 14:00",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>City</th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>State</th>\n      <th>Time</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Ithaca</td>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>NY</td>\n      <td>6/1/1930 22:00</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Willingboro</td>\n      <td>NaN</td>\n      <td>OTHER</td>\n      <td>NJ</td>\n      <td>6/30/1930 20:00</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Holyoke</td>\n      <td>NaN</td>\n      <td>OVAL</td>\n      <td>CO</td>\n      <td>2/15/1931 14:00</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 19
    }
   ],
   "source": [
    "# rows 0 and 1 and 2, all columns\n",
    "ufo.loc[[0, 1, 2], :]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "          City Colors Reported Shape Reported State             Time\n0       Ithaca             NaN       TRIANGLE    NY   6/1/1930 22:00\n1  Willingboro             NaN          OTHER    NJ  6/30/1930 20:00\n2      Holyoke             NaN           OVAL    CO  2/15/1931 14:00",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>City</th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>State</th>\n      <th>Time</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Ithaca</td>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>NY</td>\n      <td>6/1/1930 22:00</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Willingboro</td>\n      <td>NaN</td>\n      <td>OTHER</td>\n      <td>NJ</td>\n      <td>6/30/1930 20:00</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Holyoke</td>\n      <td>NaN</td>\n      <td>OVAL</td>\n      <td>CO</td>\n      <td>2/15/1931 14:00</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 20
    }
   ],
   "source": [
    "# rows 0 through 2 (inclusive), all columns\n",
    "ufo.loc[0:2, :]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "          City State\n0       Ithaca    NY\n1  Willingboro    NJ\n2      Holyoke    CO",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>City</th>\n      <th>State</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Ithaca</td>\n      <td>NY</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Willingboro</td>\n      <td>NJ</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Holyoke</td>\n      <td>CO</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 21
    }
   ],
   "source": [
    "# rows 0 through 2 (inclusive), columns 'City' and 'State'\n",
    "ufo.loc[0:2, ['City', 'State']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "          City Colors Reported Shape Reported State\n0       Ithaca             NaN       TRIANGLE    NY\n1  Willingboro             NaN          OTHER    NJ\n2      Holyoke             NaN           OVAL    CO",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>City</th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>State</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Ithaca</td>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>NY</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Willingboro</td>\n      <td>NaN</td>\n      <td>OTHER</td>\n      <td>NJ</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Holyoke</td>\n      <td>NaN</td>\n      <td>OVAL</td>\n      <td>CO</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 22
    }
   ],
   "source": [
    "# rows 0 through 2 (inclusive), columns 'City' through 'State' (inclusive)\n",
    "ufo.loc[0:2, 'City':'State']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The [**`iloc`**](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.iloc.html) method is used to select rows and columns by **integer position**. You can pass it:\n",
    "\n",
    "- A single integer position\n",
    "- A list of integer positions\n",
    "- A slice of integer positions\n",
    "- A colon (which indicates \"all integer positions\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "          City State\n0       Ithaca    NY\n1  Willingboro    NJ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>City</th>\n      <th>State</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Ithaca</td>\n      <td>NY</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Willingboro</td>\n      <td>NJ</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 23
    }
   ],
   "source": [
    "# rows in positions 0 and 1, columns in positions 0 and 3\n",
    "ufo.iloc[[0, 1], [0, 3]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "          City Colors Reported Shape Reported State\n0       Ithaca             NaN       TRIANGLE    NY\n1  Willingboro             NaN          OTHER    NJ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>City</th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>State</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Ithaca</td>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>NY</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Willingboro</td>\n      <td>NaN</td>\n      <td>OTHER</td>\n      <td>NJ</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 24
    }
   ],
   "source": [
    "# rows in positions 0 through 2 (exclusive), columns in positions 0 through 4 (exclusive)\n",
    "ufo.iloc[0:2, 0:4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "          City Colors Reported Shape Reported State             Time\n0       Ithaca             NaN       TRIANGLE    NY   6/1/1930 22:00\n1  Willingboro             NaN          OTHER    NJ  6/30/1930 20:00",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>City</th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>State</th>\n      <th>Time</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Ithaca</td>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>NY</td>\n      <td>6/1/1930 22:00</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Willingboro</td>\n      <td>NaN</td>\n      <td>OTHER</td>\n      <td>NJ</td>\n      <td>6/30/1930 20:00</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 25
    }
   ],
   "source": [
    "# rows in positions 0 through 2 (exclusive), all columns\n",
    "ufo.iloc[0:2, :]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": "Venusaur\n"
    }
   ],
   "source": [
    "# read a specific column\n",
    "df.columns \n",
    "print(df.iloc[2,1])\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Sorting/Describing Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "542     (500) Days of Summer\n5               12 Angry Men\n201         12 Years a Slave\n698                127 Hours\n110    2001: A Space Odyssey\nName: title, dtype: object"
     },
     "metadata": {},
     "execution_count": 27
    }
   ],
   "source": [
    "# sort the 'title' Series in ascending order (returns a Series)\n",
    "movies.title.sort_values().head()\n",
    "\n",
    "# sort in descending order instead\n",
    "#movies.title.sort_values(ascending=False).head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "     star_rating             title content_rating   genre  duration  \\\n864          7.5             [Rec]              R  Horror        78   \n526          7.8              Zulu        UNRATED   Drama       138   \n615          7.7        Zombieland              R  Comedy        88   \n677          7.7            Zodiac              R   Crime       157   \n955          7.4  Zero Dark Thirty              R   Drama       157   \n\n                                           actors_list  \n864  [u&#39;Manuela Velasco&#39;, u&#39;Ferran Terraza&#39;, u&#39;Jorg...  \n526  [u&#39;Stanley Baker&#39;, u&#39;Jack Hawkins&#39;, u&#39;Ulla Jac...  \n615  [u&#39;Jesse Eisenberg&#39;, u&#39;Emma Stone&#39;, u&#39;Woody Ha...  \n677  [u&#39;Jake Gyllenhaal&#39;, u&#39;Robert Downey Jr.&#39;, u&#39;M...  \n955  [u&#39;Jessica Chastain&#39;, u&#39;Joel Edgerton&#39;, u&#39;Chri...  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>star_rating</th>\n      <th>title</th>\n      <th>content_rating</th>\n      <th>genre</th>\n      <th>duration</th>\n      <th>actors_list</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>864</th>\n      <td>7.5</td>\n      <td>[Rec]</td>\n      <td>R</td>\n      <td>Horror</td>\n      <td>78</td>\n      <td>[u'Manuela Velasco', u'Ferran Terraza', u'Jorg...</td>\n    </tr>\n    <tr>\n      <th>526</th>\n      <td>7.8</td>\n      <td>Zulu</td>\n      <td>UNRATED</td>\n      <td>Drama</td>\n      <td>138</td>\n      <td>[u'Stanley Baker', u'Jack Hawkins', u'Ulla Jac...</td>\n    </tr>\n    <tr>\n      <th>615</th>\n      <td>7.7</td>\n      <td>Zombieland</td>\n      <td>R</td>\n      <td>Comedy</td>\n      <td>88</td>\n      <td>[u'Jesse Eisenberg', u'Emma Stone', u'Woody Ha...</td>\n    </tr>\n    <tr>\n      <th>677</th>\n      <td>7.7</td>\n      <td>Zodiac</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>157</td>\n      <td>[u'Jake Gyllenhaal', u'Robert Downey Jr.', u'M...</td>\n    </tr>\n    <tr>\n      <th>955</th>\n      <td>7.4</td>\n      <td>Zero Dark Thirty</td>\n      <td>R</td>\n      <td>Drama</td>\n      <td>157</td>\n      <td>[u'Jessica Chastain', u'Joel Edgerton', u'Chri...</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 28
    }
   ],
   "source": [
    "movies.sort_values('title', ascending=False).head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "       #                     Name Type 1    Type 2  HP  Attack  Defense  \\\n139  129                 Magikarp  Water       NaN  20      10       55   \n381  349                   Feebas  Water       NaN  20      15       20   \n97    90                 Shellder  Water       NaN  30      65      100   \n106   98                   Krabby  Water       NaN  30     105       90   \n125  116                   Horsea  Water       NaN  30      40       70   \n..   ...                      ...    ...       ...  ..     ...      ...   \n232  214  HeracrossMega Heracross    Bug  Fighting  80     185      115   \n678  617                 Accelgor    Bug       NaN  80      70       40   \n734  666                 Vivillon    Bug    Flying  80      52       50   \n698  637                Volcarona    Bug      Fire  85      60       65   \n520  469                  Yanmega    Bug    Flying  86      76       86   \n\n     Sp. Atk  Sp. Def  Speed  Generation  Legendary  \n139       15       20     80           1      False  \n381       10       55     80           3      False  \n97        45       25     40           1      False  \n106       25       25     50           1      False  \n125       70       25     60           1      False  \n..       ...      ...    ...         ...        ...  \n232       40      105     75           2      False  \n678      100       60    145           5      False  \n734       90       50     89           6      False  \n698      135      105    100           5      False  \n520      116       56     95           4      False  \n\n[800 rows x 12 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>#</th>\n      <th>Name</th>\n      <th>Type 1</th>\n      <th>Type 2</th>\n      <th>HP</th>\n      <th>Attack</th>\n      <th>Defense</th>\n      <th>Sp. Atk</th>\n      <th>Sp. Def</th>\n      <th>Speed</th>\n      <th>Generation</th>\n      <th>Legendary</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>139</th>\n      <td>129</td>\n      <td>Magikarp</td>\n      <td>Water</td>\n      <td>NaN</td>\n      <td>20</td>\n      <td>10</td>\n      <td>55</td>\n      <td>15</td>\n      <td>20</td>\n      <td>80</td>\n      <td>1</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>381</th>\n      <td>349</td>\n      <td>Feebas</td>\n      <td>Water</td>\n      <td>NaN</td>\n      <td>20</td>\n      <td>15</td>\n      <td>20</td>\n      <td>10</td>\n      <td>55</td>\n      <td>80</td>\n      <td>3</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>97</th>\n      <td>90</td>\n      <td>Shellder</td>\n      <td>Water</td>\n      <td>NaN</td>\n      <td>30</td>\n      <td>65</td>\n      <td>100</td>\n      <td>45</td>\n      <td>25</td>\n      <td>40</td>\n      <td>1</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>106</th>\n      <td>98</td>\n      <td>Krabby</td>\n      <td>Water</td>\n      <td>NaN</td>\n      <td>30</td>\n      <td>105</td>\n      <td>90</td>\n      <td>25</td>\n      <td>25</td>\n      <td>50</td>\n      <td>1</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>125</th>\n      <td>116</td>\n      <td>Horsea</td>\n      <td>Water</td>\n      <td>NaN</td>\n      <td>30</td>\n      <td>40</td>\n      <td>70</td>\n      <td>70</td>\n      <td>25</td>\n      <td>60</td>\n      <td>1</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>232</th>\n      <td>214</td>\n      <td>HeracrossMega Heracross</td>\n      <td>Bug</td>\n      <td>Fighting</td>\n      <td>80</td>\n      <td>185</td>\n      <td>115</td>\n      <td>40</td>\n      <td>105</td>\n      <td>75</td>\n      <td>2</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>678</th>\n      <td>617</td>\n      <td>Accelgor</td>\n      <td>Bug</td>\n      <td>NaN</td>\n      <td>80</td>\n      <td>70</td>\n      <td>40</td>\n      <td>100</td>\n      <td>60</td>\n      <td>145</td>\n      <td>5</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>734</th>\n      <td>666</td>\n      <td>Vivillon</td>\n      <td>Bug</td>\n      <td>Flying</td>\n      <td>80</td>\n      <td>52</td>\n      <td>50</td>\n      <td>90</td>\n      <td>50</td>\n      <td>89</td>\n      <td>6</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>698</th>\n      <td>637</td>\n      <td>Volcarona</td>\n      <td>Bug</td>\n      <td>Fire</td>\n      <td>85</td>\n      <td>60</td>\n      <td>65</td>\n      <td>135</td>\n      <td>105</td>\n      <td>100</td>\n      <td>5</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>520</th>\n      <td>469</td>\n      <td>Yanmega</td>\n      <td>Bug</td>\n      <td>Flying</td>\n      <td>86</td>\n      <td>76</td>\n      <td>86</td>\n      <td>116</td>\n      <td>56</td>\n      <td>95</td>\n      <td>4</td>\n      <td>False</td>\n    </tr>\n  </tbody>\n</table>\n<p>800 rows × 12 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 29
    }
   ],
   "source": [
    "df.sort_values(['Type 1', 'HP'], ascending=[False,True])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   star_rating                                          title content_rating  \\\n0          9.3                       The Shawshank Redemption              R   \n1          9.2                                  The Godfather              R   \n2          9.1                         The Godfather: Part II              R   \n3          9.0                                The Dark Knight          PG-13   \n5          8.9                                   12 Angry Men      NOT RATED   \n9          8.9                                     Fight Club              R   \n4          8.9                                   Pulp Fiction              R   \n6          8.9                 The Good, the Bad and the Ugly      NOT RATED   \n8          8.9                               Schindler&#39;s List              R   \n7          8.9  The Lord of the Rings: The Return of the King          PG-13   \n\n       genre  duration                                        actors_list  \n0      Crime       142  [u&#39;Tim Robbins&#39;, u&#39;Morgan Freeman&#39;, u&#39;Bob Gunt...  \n1      Crime       175    [u&#39;Marlon Brando&#39;, u&#39;Al Pacino&#39;, u&#39;James Caan&#39;]  \n2      Crime       200  [u&#39;Al Pacino&#39;, u&#39;Robert De Niro&#39;, u&#39;Robert Duv...  \n3     Action       152  [u&#39;Christian Bale&#39;, u&#39;Heath Ledger&#39;, u&#39;Aaron E...  \n5      Drama        96  [u&#39;Henry Fonda&#39;, u&#39;Lee J. Cobb&#39;, u&#39;Martin Bals...  \n9      Drama       139  [u&#39;Brad Pitt&#39;, u&#39;Edward Norton&#39;, u&#39;Helena Bonh...  \n4      Crime       154  [u&#39;John Travolta&#39;, u&#39;Uma Thurman&#39;, u&#39;Samuel L....  \n6    Western       161  [u&#39;Clint Eastwood&#39;, u&#39;Eli Wallach&#39;, u&#39;Lee Van ...  \n8  Biography       195  [u&#39;Liam Neeson&#39;, u&#39;Ralph Fiennes&#39;, u&#39;Ben Kings...  \n7  Adventure       201  [u&#39;Elijah Wood&#39;, u&#39;Viggo Mortensen&#39;, u&#39;Ian McK...  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>star_rating</th>\n      <th>title</th>\n      <th>content_rating</th>\n      <th>genre</th>\n      <th>duration</th>\n      <th>actors_list</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>9.3</td>\n      <td>The Shawshank Redemption</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>142</td>\n      <td>[u'Tim Robbins', u'Morgan Freeman', u'Bob Gunt...</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>9.2</td>\n      <td>The Godfather</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>175</td>\n      <td>[u'Marlon Brando', u'Al Pacino', u'James Caan']</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>9.1</td>\n      <td>The Godfather: Part II</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>200</td>\n      <td>[u'Al Pacino', u'Robert De Niro', u'Robert Duv...</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>9.0</td>\n      <td>The Dark Knight</td>\n      <td>PG-13</td>\n      <td>Action</td>\n      <td>152</td>\n      <td>[u'Christian Bale', u'Heath Ledger', u'Aaron E...</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>8.9</td>\n      <td>12 Angry Men</td>\n      <td>NOT RATED</td>\n      <td>Drama</td>\n      <td>96</td>\n      <td>[u'Henry Fonda', u'Lee J. Cobb', u'Martin Bals...</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>8.9</td>\n      <td>Fight Club</td>\n      <td>R</td>\n      <td>Drama</td>\n      <td>139</td>\n      <td>[u'Brad Pitt', u'Edward Norton', u'Helena Bonh...</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>8.9</td>\n      <td>Pulp Fiction</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>154</td>\n      <td>[u'John Travolta', u'Uma Thurman', u'Samuel L....</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>8.9</td>\n      <td>The Good, the Bad and the Ugly</td>\n      <td>NOT RATED</td>\n      <td>Western</td>\n      <td>161</td>\n      <td>[u'Clint Eastwood', u'Eli Wallach', u'Lee Van ...</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>8.9</td>\n      <td>Schindler's List</td>\n      <td>R</td>\n      <td>Biography</td>\n      <td>195</td>\n      <td>[u'Liam Neeson', u'Ralph Fiennes', u'Ben Kings...</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>8.9</td>\n      <td>The Lord of the Rings: The Return of the King</td>\n      <td>PG-13</td>\n      <td>Adventure</td>\n      <td>201</td>\n      <td>[u'Elijah Wood', u'Viggo Mortensen', u'Ian McK...</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 30
    }
   ],
   "source": [
    "movies.sort_values(['star_rating', 'duration','content_rating'],ascending=[False,True,True]).head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Making changes to the data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "                   City Colors Reported Shape Reported State             Time  \\\n0                Ithaca             NaN       TRIANGLE    NY   6/1/1930 22:00   \n1           Willingboro             NaN          OTHER    NJ  6/30/1930 20:00   \n2               Holyoke             NaN           OVAL    CO  2/15/1931 14:00   \n3               Abilene             NaN           DISK    KS   6/1/1931 13:00   \n4  New York Worlds Fair             NaN          LIGHT    NY  4/18/1933 19:00   \n\n                   Location  \n0                Ithaca, NY  \n1           Willingboro, NJ  \n2               Holyoke, CO  \n3               Abilene, KS  \n4  New York Worlds Fair, NY  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>City</th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>State</th>\n      <th>Time</th>\n      <th>Location</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Ithaca</td>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>NY</td>\n      <td>6/1/1930 22:00</td>\n      <td>Ithaca, NY</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Willingboro</td>\n      <td>NaN</td>\n      <td>OTHER</td>\n      <td>NJ</td>\n      <td>6/30/1930 20:00</td>\n      <td>Willingboro, NJ</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Holyoke</td>\n      <td>NaN</td>\n      <td>OVAL</td>\n      <td>CO</td>\n      <td>2/15/1931 14:00</td>\n      <td>Holyoke, CO</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>Abilene</td>\n      <td>NaN</td>\n      <td>DISK</td>\n      <td>KS</td>\n      <td>6/1/1931 13:00</td>\n      <td>Abilene, KS</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>New York Worlds Fair</td>\n      <td>NaN</td>\n      <td>LIGHT</td>\n      <td>NY</td>\n      <td>4/18/1933 19:00</td>\n      <td>New York Worlds Fair, NY</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 31
    }
   ],
   "source": [
    "# Create a new series inside the orignal series\n",
    "\n",
    "ufo['Location'] = ufo.City + ', ' + ufo.State     # Create a new series inside the orignal series\n",
    "ufo.head()\n",
    "\n",
    "# df = df.drop(columns=['Total'])\n",
    "\n",
    "#df['Total'] = df.iloc[:, 4:10].sum(axis=1)\n",
    "\n",
    "#cols = list(df.columns)\n",
    "#df = df[cols[0:4] + [cols[-1]]+cols[4:12]]\n",
    "\n",
    "#df.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   #                   Name Type 1  Type 2  HP  Attack  Defense  Sp. Atk  \\\n0  1              Bulbasaur  Grass  Poison  45      49       49       65   \n1  2                Ivysaur  Grass  Poison  60      62       63       80   \n2  3               Venusaur  Grass  Poison  80      82       83      100   \n3  3  VenusaurMega Venusaur  Grass  Poison  80     100      123      122   \n4  4             Charmander   Fire     NaN  39      52       43       60   \n\n   Sp. Def  Speed  Generation  Legendary  Total  \n0       65     45           1      False    318  \n1       80     60           1      False    405  \n2      100     80           1      False    525  \n3      120     80           1      False    625  \n4       50     65           1      False    309  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>#</th>\n      <th>Name</th>\n      <th>Type 1</th>\n      <th>Type 2</th>\n      <th>HP</th>\n      <th>Attack</th>\n      <th>Defense</th>\n      <th>Sp. Atk</th>\n      <th>Sp. Def</th>\n      <th>Speed</th>\n      <th>Generation</th>\n      <th>Legendary</th>\n      <th>Total</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>Bulbasaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>45</td>\n      <td>49</td>\n      <td>49</td>\n      <td>65</td>\n      <td>65</td>\n      <td>45</td>\n      <td>1</td>\n      <td>False</td>\n      <td>318</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>Ivysaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>60</td>\n      <td>62</td>\n      <td>63</td>\n      <td>80</td>\n      <td>80</td>\n      <td>60</td>\n      <td>1</td>\n      <td>False</td>\n      <td>405</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>Venusaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>80</td>\n      <td>82</td>\n      <td>83</td>\n      <td>100</td>\n      <td>100</td>\n      <td>80</td>\n      <td>1</td>\n      <td>False</td>\n      <td>525</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>3</td>\n      <td>VenusaurMega Venusaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>80</td>\n      <td>100</td>\n      <td>123</td>\n      <td>122</td>\n      <td>120</td>\n      <td>80</td>\n      <td>1</td>\n      <td>False</td>\n      <td>625</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>4</td>\n      <td>Charmander</td>\n      <td>Fire</td>\n      <td>NaN</td>\n      <td>39</td>\n      <td>52</td>\n      <td>43</td>\n      <td>60</td>\n      <td>50</td>\n      <td>65</td>\n      <td>1</td>\n      <td>False</td>\n      <td>309</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 32
    }
   ],
   "source": [
    "df['Total'] = df['HP'] + df['Attack'] + df['Defense'] + df['Sp. Atk'] + df['Sp. Def'] + df['Speed']\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   #                Pokemon Type 1  Type 2  HP  Attack  Defense  Sp. Atk  \\\n0  1              Bulbasaur  Grass  Poison  45      49       49       65   \n1  2                Ivysaur  Grass  Poison  60      62       63       80   \n2  3               Venusaur  Grass  Poison  80      82       83      100   \n3  3  VenusaurMega Venusaur  Grass  Poison  80     100      123      122   \n4  4             Charmander   Fire     NaN  39      52       43       60   \n\n   Sp. Def  Speed  Generation  Legendary  Total  \n0       65     45           1      False    318  \n1       80     60           1      False    405  \n2      100     80           1      False    525  \n3      120     80           1      False    625  \n4       50     65           1      False    309  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>#</th>\n      <th>Pokemon</th>\n      <th>Type 1</th>\n      <th>Type 2</th>\n      <th>HP</th>\n      <th>Attack</th>\n      <th>Defense</th>\n      <th>Sp. Atk</th>\n      <th>Sp. Def</th>\n      <th>Speed</th>\n      <th>Generation</th>\n      <th>Legendary</th>\n      <th>Total</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>Bulbasaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>45</td>\n      <td>49</td>\n      <td>49</td>\n      <td>65</td>\n      <td>65</td>\n      <td>45</td>\n      <td>1</td>\n      <td>False</td>\n      <td>318</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>Ivysaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>60</td>\n      <td>62</td>\n      <td>63</td>\n      <td>80</td>\n      <td>80</td>\n      <td>60</td>\n      <td>1</td>\n      <td>False</td>\n      <td>405</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>Venusaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>80</td>\n      <td>82</td>\n      <td>83</td>\n      <td>100</td>\n      <td>100</td>\n      <td>80</td>\n      <td>1</td>\n      <td>False</td>\n      <td>525</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>3</td>\n      <td>VenusaurMega Venusaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>80</td>\n      <td>100</td>\n      <td>123</td>\n      <td>122</td>\n      <td>120</td>\n      <td>80</td>\n      <td>1</td>\n      <td>False</td>\n      <td>625</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>4</td>\n      <td>Charmander</td>\n      <td>Fire</td>\n      <td>NaN</td>\n      <td>39</td>\n      <td>52</td>\n      <td>43</td>\n      <td>60</td>\n      <td>50</td>\n      <td>65</td>\n      <td>1</td>\n      <td>False</td>\n      <td>309</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 33
    }
   ],
   "source": [
    "# rename a column\n",
    "\n",
    "df.rename(columns={'Name':'Pokemon'}, inplace = True )  \n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "  Colors Reported Shape Reported             Time                  Location\n0             NaN       TRIANGLE   6/1/1930 22:00                Ithaca, NY\n1             NaN          OTHER  6/30/1930 20:00           Willingboro, NJ\n2             NaN           OVAL  2/15/1931 14:00               Holyoke, CO\n3             NaN           DISK   6/1/1931 13:00               Abilene, KS\n4             NaN          LIGHT  4/18/1933 19:00  New York Worlds Fair, NY",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>Time</th>\n      <th>Location</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>6/1/1930 22:00</td>\n      <td>Ithaca, NY</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>NaN</td>\n      <td>OTHER</td>\n      <td>6/30/1930 20:00</td>\n      <td>Willingboro, NJ</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>NaN</td>\n      <td>OVAL</td>\n      <td>2/15/1931 14:00</td>\n      <td>Holyoke, CO</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>NaN</td>\n      <td>DISK</td>\n      <td>6/1/1931 13:00</td>\n      <td>Abilene, KS</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>NaN</td>\n      <td>LIGHT</td>\n      <td>4/18/1933 19:00</td>\n      <td>New York Worlds Fair, NY</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 34
    }
   ],
   "source": [
    "# remove columns\n",
    "\n",
    "ufo.drop(['City', 'State'], axis=1, inplace=True)       # Column axis=1  &  Row axis=0\n",
    "ufo.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Saving our Data (Exporting into Desired Format)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# df.to_csv('modified.csv', index=False)\n",
    "\n",
    "#df.to_excel('modified.xlsx', index=False)\n",
    "\n",
    "df.to_csv('modified.txt', index=False, sep='\\t')\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Filtering Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "0      142\n1      175\n2      200\n3      152\n4      154\n      ... \n974    116\n975    118\n976    138\n977    114\n978    126\nName: duration, Length: 979, dtype: int64"
     },
     "metadata": {},
     "execution_count": 35
    }
   ],
   "source": [
    "movies.duration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "0      False\n1      False\n2       True\n3      False\n4      False\n       ...  \n974    False\n975    False\n976    False\n977    False\n978    False\nName: duration, Length: 979, dtype: bool"
     },
     "metadata": {},
     "execution_count": 36
    }
   ],
   "source": [
    "movies.duration >= 200"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "     star_rating                                          title  \\\n2            9.1                         The Godfather: Part II   \n7            8.9  The Lord of the Rings: The Return of the King   \n17           8.7                                  Seven Samurai   \n78           8.4                    Once Upon a Time in America   \n85           8.4                             Lawrence of Arabia   \n142          8.3              Lagaan: Once Upon a Time in India   \n157          8.2                             Gone with the Wind   \n204          8.1                                        Ben-Hur   \n445          7.9                           The Ten Commandments   \n476          7.8                                         Hamlet   \n630          7.7                                      Malcolm X   \n767          7.6                It&#39;s a Mad, Mad, Mad, Mad World   \n\n    content_rating      genre  duration  \\\n2                R      Crime       200   \n7            PG-13  Adventure       201   \n17         UNRATED      Drama       207   \n78               R      Crime       229   \n85              PG  Adventure       216   \n142             PG  Adventure       224   \n157              G      Drama       238   \n204              G  Adventure       212   \n445       APPROVED  Adventure       220   \n476          PG-13      Drama       242   \n630          PG-13  Biography       202   \n767       APPROVED     Action       205   \n\n                                           actors_list  \n2    [u&#39;Al Pacino&#39;, u&#39;Robert De Niro&#39;, u&#39;Robert Duv...  \n7    [u&#39;Elijah Wood&#39;, u&#39;Viggo Mortensen&#39;, u&#39;Ian McK...  \n17   [u&#39;Toshir\\xf4 Mifune&#39;, u&#39;Takashi Shimura&#39;, u&#39;K...  \n78   [u&#39;Robert De Niro&#39;, u&#39;James Woods&#39;, u&#39;Elizabet...  \n85   [u&quot;Peter O&#39;Toole&quot;, u&#39;Alec Guinness&#39;, u&#39;Anthony...  \n142  [u&#39;Aamir Khan&#39;, u&#39;Gracy Singh&#39;, u&#39;Rachel Shell...  \n157  [u&#39;Clark Gable&#39;, u&#39;Vivien Leigh&#39;, u&#39;Thomas Mit...  \n204  [u&#39;Charlton Heston&#39;, u&#39;Jack Hawkins&#39;, u&#39;Stephe...  \n445  [u&#39;Charlton Heston&#39;, u&#39;Yul Brynner&#39;, u&#39;Anne Ba...  \n476  [u&#39;Kenneth Branagh&#39;, u&#39;Julie Christie&#39;, u&#39;Dere...  \n630  [u&#39;Denzel Washington&#39;, u&#39;Angela Bassett&#39;, u&#39;De...  \n767  [u&#39;Spencer Tracy&#39;, u&#39;Milton Berle&#39;, u&#39;Ethel Me...  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>star_rating</th>\n      <th>title</th>\n      <th>content_rating</th>\n      <th>genre</th>\n      <th>duration</th>\n      <th>actors_list</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2</th>\n      <td>9.1</td>\n      <td>The Godfather: Part II</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>200</td>\n      <td>[u'Al Pacino', u'Robert De Niro', u'Robert Duv...</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>8.9</td>\n      <td>The Lord of the Rings: The Return of the King</td>\n      <td>PG-13</td>\n      <td>Adventure</td>\n      <td>201</td>\n      <td>[u'Elijah Wood', u'Viggo Mortensen', u'Ian McK...</td>\n    </tr>\n    <tr>\n      <th>17</th>\n      <td>8.7</td>\n      <td>Seven Samurai</td>\n      <td>UNRATED</td>\n      <td>Drama</td>\n      <td>207</td>\n      <td>[u'Toshir\\xf4 Mifune', u'Takashi Shimura', u'K...</td>\n    </tr>\n    <tr>\n      <th>78</th>\n      <td>8.4</td>\n      <td>Once Upon a Time in America</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>229</td>\n      <td>[u'Robert De Niro', u'James Woods', u'Elizabet...</td>\n    </tr>\n    <tr>\n      <th>85</th>\n      <td>8.4</td>\n      <td>Lawrence of Arabia</td>\n      <td>PG</td>\n      <td>Adventure</td>\n      <td>216</td>\n      <td>[u\"Peter O'Toole\", u'Alec Guinness', u'Anthony...</td>\n    </tr>\n    <tr>\n      <th>142</th>\n      <td>8.3</td>\n      <td>Lagaan: Once Upon a Time in India</td>\n      <td>PG</td>\n      <td>Adventure</td>\n      <td>224</td>\n      <td>[u'Aamir Khan', u'Gracy Singh', u'Rachel Shell...</td>\n    </tr>\n    <tr>\n      <th>157</th>\n      <td>8.2</td>\n      <td>Gone with the Wind</td>\n      <td>G</td>\n      <td>Drama</td>\n      <td>238</td>\n      <td>[u'Clark Gable', u'Vivien Leigh', u'Thomas Mit...</td>\n    </tr>\n    <tr>\n      <th>204</th>\n      <td>8.1</td>\n      <td>Ben-Hur</td>\n      <td>G</td>\n      <td>Adventure</td>\n      <td>212</td>\n      <td>[u'Charlton Heston', u'Jack Hawkins', u'Stephe...</td>\n    </tr>\n    <tr>\n      <th>445</th>\n      <td>7.9</td>\n      <td>The Ten Commandments</td>\n      <td>APPROVED</td>\n      <td>Adventure</td>\n      <td>220</td>\n      <td>[u'Charlton Heston', u'Yul Brynner', u'Anne Ba...</td>\n    </tr>\n    <tr>\n      <th>476</th>\n      <td>7.8</td>\n      <td>Hamlet</td>\n      <td>PG-13</td>\n      <td>Drama</td>\n      <td>242</td>\n      <td>[u'Kenneth Branagh', u'Julie Christie', u'Dere...</td>\n    </tr>\n    <tr>\n      <th>630</th>\n      <td>7.7</td>\n      <td>Malcolm X</td>\n      <td>PG-13</td>\n      <td>Biography</td>\n      <td>202</td>\n      <td>[u'Denzel Washington', u'Angela Bassett', u'De...</td>\n    </tr>\n    <tr>\n      <th>767</th>\n      <td>7.6</td>\n      <td>It's a Mad, Mad, Mad, Mad World</td>\n      <td>APPROVED</td>\n      <td>Action</td>\n      <td>205</td>\n      <td>[u'Spencer Tracy', u'Milton Berle', u'Ethel Me...</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 37
    }
   ],
   "source": [
    "movies[movies.duration >= 200] "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "2                             The Godfather: Part II\n7      The Lord of the Rings: The Return of the King\n17                                     Seven Samurai\n78                       Once Upon a Time in America\n85                                Lawrence of Arabia\n142                Lagaan: Once Upon a Time in India\n157                               Gone with the Wind\n204                                          Ben-Hur\n445                             The Ten Commandments\n476                                           Hamlet\n630                                        Malcolm X\n767                  It&#39;s a Mad, Mad, Mad, Mad World\nName: title, dtype: object"
     },
     "metadata": {},
     "execution_count": 38
    }
   ],
   "source": [
    "movies[movies.duration >= 200].title #spicifying movies titles only which are greater than 200 minutes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Understanding **logical operators:**\n",
    "\n",
    "- **`and`**: True only if **both sides** of the operator are True\n",
    "- **`or`**: True if **either side** of the operator is True\n",
    "\n",
    "Rules for specifying **multiple filter criteria** in pandas:\n",
    "\n",
    "- use **`&`** instead of **`and`**\n",
    "- use **`|`** instead of **`or`**\n",
    "- add **parentheses** around each condition to specify evaluation order\n",
    "\n",
    "**Goal:** Further filter the DataFrame of long movies (duration >= 200) to only show movies which also have a 'genre' of 'Drama'\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "     star_rating               title content_rating  genre  duration  \\\n17           8.7       Seven Samurai        UNRATED  Drama       207   \n157          8.2  Gone with the Wind              G  Drama       238   \n476          7.8              Hamlet          PG-13  Drama       242   \n\n                                           actors_list  \n17   [u&#39;Toshir\\xf4 Mifune&#39;, u&#39;Takashi Shimura&#39;, u&#39;K...  \n157  [u&#39;Clark Gable&#39;, u&#39;Vivien Leigh&#39;, u&#39;Thomas Mit...  \n476  [u&#39;Kenneth Branagh&#39;, u&#39;Julie Christie&#39;, u&#39;Dere...  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>star_rating</th>\n      <th>title</th>\n      <th>content_rating</th>\n      <th>genre</th>\n      <th>duration</th>\n      <th>actors_list</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>17</th>\n      <td>8.7</td>\n      <td>Seven Samurai</td>\n      <td>UNRATED</td>\n      <td>Drama</td>\n      <td>207</td>\n      <td>[u'Toshir\\xf4 Mifune', u'Takashi Shimura', u'K...</td>\n    </tr>\n    <tr>\n      <th>157</th>\n      <td>8.2</td>\n      <td>Gone with the Wind</td>\n      <td>G</td>\n      <td>Drama</td>\n      <td>238</td>\n      <td>[u'Clark Gable', u'Vivien Leigh', u'Thomas Mit...</td>\n    </tr>\n    <tr>\n      <th>476</th>\n      <td>7.8</td>\n      <td>Hamlet</td>\n      <td>PG-13</td>\n      <td>Drama</td>\n      <td>242</td>\n      <td>[u'Kenneth Branagh', u'Julie Christie', u'Dere...</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 39
    }
   ],
   "source": [
    "movies[(movies.duration >=200) & (movies.genre == 'Drama')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "    star_rating                                          title content_rating  \\\n2           9.1                         The Godfather: Part II              R   \n5           8.9                                   12 Angry Men      NOT RATED   \n7           8.9  The Lord of the Rings: The Return of the King          PG-13   \n9           8.9                                     Fight Club              R   \n13          8.8                                   Forrest Gump          PG-13   \n\n        genre  duration                                        actors_list  \n2       Crime       200  [u&#39;Al Pacino&#39;, u&#39;Robert De Niro&#39;, u&#39;Robert Duv...  \n5       Drama        96  [u&#39;Henry Fonda&#39;, u&#39;Lee J. Cobb&#39;, u&#39;Martin Bals...  \n7   Adventure       201  [u&#39;Elijah Wood&#39;, u&#39;Viggo Mortensen&#39;, u&#39;Ian McK...  \n9       Drama       139  [u&#39;Brad Pitt&#39;, u&#39;Edward Norton&#39;, u&#39;Helena Bonh...  \n13      Drama       142    [u&#39;Tom Hanks&#39;, u&#39;Robin Wright&#39;, u&#39;Gary Sinise&#39;]  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>star_rating</th>\n      <th>title</th>\n      <th>content_rating</th>\n      <th>genre</th>\n      <th>duration</th>\n      <th>actors_list</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2</th>\n      <td>9.1</td>\n      <td>The Godfather: Part II</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>200</td>\n      <td>[u'Al Pacino', u'Robert De Niro', u'Robert Duv...</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>8.9</td>\n      <td>12 Angry Men</td>\n      <td>NOT RATED</td>\n      <td>Drama</td>\n      <td>96</td>\n      <td>[u'Henry Fonda', u'Lee J. Cobb', u'Martin Bals...</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>8.9</td>\n      <td>The Lord of the Rings: The Return of the King</td>\n      <td>PG-13</td>\n      <td>Adventure</td>\n      <td>201</td>\n      <td>[u'Elijah Wood', u'Viggo Mortensen', u'Ian McK...</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>8.9</td>\n      <td>Fight Club</td>\n      <td>R</td>\n      <td>Drama</td>\n      <td>139</td>\n      <td>[u'Brad Pitt', u'Edward Norton', u'Helena Bonh...</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>8.8</td>\n      <td>Forrest Gump</td>\n      <td>PG-13</td>\n      <td>Drama</td>\n      <td>142</td>\n      <td>[u'Tom Hanks', u'Robin Wright', u'Gary Sinise']</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 40
    }
   ],
   "source": [
    "movies[(movies.duration >=200) | (movies.genre == 'Drama')].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "    star_rating                                           title  \\\n0           9.3                        The Shawshank Redemption   \n1           9.2                                   The Godfather   \n2           9.1                          The Godfather: Part II   \n3           9.0                                 The Dark Knight   \n4           8.9                                    Pulp Fiction   \n5           8.9                                    12 Angry Men   \n9           8.9                                      Fight Club   \n11          8.8                                       Inception   \n12          8.8  Star Wars: Episode V - The Empire Strikes Back   \n13          8.8                                    Forrest Gump   \n\n   content_rating   genre  duration  \\\n0               R   Crime       142   \n1               R   Crime       175   \n2               R   Crime       200   \n3           PG-13  Action       152   \n4               R   Crime       154   \n5       NOT RATED   Drama        96   \n9               R   Drama       139   \n11          PG-13  Action       148   \n12             PG  Action       124   \n13          PG-13   Drama       142   \n\n                                          actors_list  \n0   [u&#39;Tim Robbins&#39;, u&#39;Morgan Freeman&#39;, u&#39;Bob Gunt...  \n1     [u&#39;Marlon Brando&#39;, u&#39;Al Pacino&#39;, u&#39;James Caan&#39;]  \n2   [u&#39;Al Pacino&#39;, u&#39;Robert De Niro&#39;, u&#39;Robert Duv...  \n3   [u&#39;Christian Bale&#39;, u&#39;Heath Ledger&#39;, u&#39;Aaron E...  \n4   [u&#39;John Travolta&#39;, u&#39;Uma Thurman&#39;, u&#39;Samuel L....  \n5   [u&#39;Henry Fonda&#39;, u&#39;Lee J. Cobb&#39;, u&#39;Martin Bals...  \n9   [u&#39;Brad Pitt&#39;, u&#39;Edward Norton&#39;, u&#39;Helena Bonh...  \n11  [u&#39;Leonardo DiCaprio&#39;, u&#39;Joseph Gordon-Levitt&#39;...  \n12  [u&#39;Mark Hamill&#39;, u&#39;Harrison Ford&#39;, u&#39;Carrie Fi...  \n13    [u&#39;Tom Hanks&#39;, u&#39;Robin Wright&#39;, u&#39;Gary Sinise&#39;]  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>star_rating</th>\n      <th>title</th>\n      <th>content_rating</th>\n      <th>genre</th>\n      <th>duration</th>\n      <th>actors_list</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>9.3</td>\n      <td>The Shawshank Redemption</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>142</td>\n      <td>[u'Tim Robbins', u'Morgan Freeman', u'Bob Gunt...</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>9.2</td>\n      <td>The Godfather</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>175</td>\n      <td>[u'Marlon Brando', u'Al Pacino', u'James Caan']</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>9.1</td>\n      <td>The Godfather: Part II</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>200</td>\n      <td>[u'Al Pacino', u'Robert De Niro', u'Robert Duv...</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>9.0</td>\n      <td>The Dark Knight</td>\n      <td>PG-13</td>\n      <td>Action</td>\n      <td>152</td>\n      <td>[u'Christian Bale', u'Heath Ledger', u'Aaron E...</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>8.9</td>\n      <td>Pulp Fiction</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>154</td>\n      <td>[u'John Travolta', u'Uma Thurman', u'Samuel L....</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>8.9</td>\n      <td>12 Angry Men</td>\n      <td>NOT RATED</td>\n      <td>Drama</td>\n      <td>96</td>\n      <td>[u'Henry Fonda', u'Lee J. Cobb', u'Martin Bals...</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>8.9</td>\n      <td>Fight Club</td>\n      <td>R</td>\n      <td>Drama</td>\n      <td>139</td>\n      <td>[u'Brad Pitt', u'Edward Norton', u'Helena Bonh...</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>8.8</td>\n      <td>Inception</td>\n      <td>PG-13</td>\n      <td>Action</td>\n      <td>148</td>\n      <td>[u'Leonardo DiCaprio', u'Joseph Gordon-Levitt'...</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>8.8</td>\n      <td>Star Wars: Episode V - The Empire Strikes Back</td>\n      <td>PG</td>\n      <td>Action</td>\n      <td>124</td>\n      <td>[u'Mark Hamill', u'Harrison Ford', u'Carrie Fi...</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>8.8</td>\n      <td>Forrest Gump</td>\n      <td>PG-13</td>\n      <td>Drama</td>\n      <td>142</td>\n      <td>[u'Tom Hanks', u'Robin Wright', u'Gary Sinise']</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 41
    }
   ],
   "source": [
    "movies[(movies.genre == 'Crime') | (movies.genre == 'Drama') | (movies.genre == 'Action')].head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "       #                Pokemon Type 1  Type 2   HP  Attack  Defense  Sp. Atk  \\\n2      3               Venusaur  Grass  Poison   80      82       83      100   \n3      3  VenusaurMega Venusaur  Grass  Poison   80     100      123      122   \n50    45              Vileplume  Grass  Poison   75      80       85      110   \n77    71             Victreebel  Grass  Poison   80     105       65      100   \n652  591              Amoonguss  Grass  Poison  114      85       70       85   \n\n     Sp. Def  Speed  Generation  Legendary  Total  \n2        100     80           1      False    525  \n3        120     80           1      False    625  \n50        90     50           1      False    490  \n77        70     70           1      False    490  \n652       80     30           5      False    464  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>#</th>\n      <th>Pokemon</th>\n      <th>Type 1</th>\n      <th>Type 2</th>\n      <th>HP</th>\n      <th>Attack</th>\n      <th>Defense</th>\n      <th>Sp. Atk</th>\n      <th>Sp. Def</th>\n      <th>Speed</th>\n      <th>Generation</th>\n      <th>Legendary</th>\n      <th>Total</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>Venusaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>80</td>\n      <td>82</td>\n      <td>83</td>\n      <td>100</td>\n      <td>100</td>\n      <td>80</td>\n      <td>1</td>\n      <td>False</td>\n      <td>525</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>3</td>\n      <td>VenusaurMega Venusaur</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>80</td>\n      <td>100</td>\n      <td>123</td>\n      <td>122</td>\n      <td>120</td>\n      <td>80</td>\n      <td>1</td>\n      <td>False</td>\n      <td>625</td>\n    </tr>\n    <tr>\n      <th>50</th>\n      <td>45</td>\n      <td>Vileplume</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>75</td>\n      <td>80</td>\n      <td>85</td>\n      <td>110</td>\n      <td>90</td>\n      <td>50</td>\n      <td>1</td>\n      <td>False</td>\n      <td>490</td>\n    </tr>\n    <tr>\n      <th>77</th>\n      <td>71</td>\n      <td>Victreebel</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>80</td>\n      <td>105</td>\n      <td>65</td>\n      <td>100</td>\n      <td>70</td>\n      <td>70</td>\n      <td>1</td>\n      <td>False</td>\n      <td>490</td>\n    </tr>\n    <tr>\n      <th>652</th>\n      <td>591</td>\n      <td>Amoonguss</td>\n      <td>Grass</td>\n      <td>Poison</td>\n      <td>114</td>\n      <td>85</td>\n      <td>70</td>\n      <td>85</td>\n      <td>80</td>\n      <td>30</td>\n      <td>5</td>\n      <td>False</td>\n      <td>464</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 42
    }
   ],
   "source": [
    "new_df = df.loc[(df['Type 1'] == 'Grass') & (df['Type 2'] == 'Poison') & (df['HP'] > 70)]\n",
    "\n",
    "#new_df.reset_index(drop=True, inplace=True)\n",
    "\n",
    "new_df\n",
    "\n",
    "#new_df.to_csv('filtered.csv')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "0    False\n1    False\n2    False\n3    False\n4     True\nName: item_name, dtype: bool"
     },
     "metadata": {},
     "execution_count": 43
    }
   ],
   "source": [
    "orders.item_name.str.contains('Chicken').head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "    order_id  quantity             item_name  \\\n4          2         2          Chicken Bowl   \n5          3         1          Chicken Bowl   \n11         6         1  Chicken Crispy Tacos   \n12         6         1    Chicken Soft Tacos   \n13         7         1          Chicken Bowl   \n\n                                   choice_description item_price  \n4   [Tomatillo-Red Chili Salsa (Hot), [Black Beans...    $16.98   \n5   [Fresh Tomato Salsa (Mild), [Rice, Cheese, Sou...    $10.98   \n11  [Roasted Chili Corn Salsa, [Fajita Vegetables,...     $8.75   \n12  [Roasted Chili Corn Salsa, [Rice, Black Beans,...     $8.75   \n13  [Fresh Tomato Salsa, [Fajita Vegetables, Rice,...    $11.25   ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>order_id</th>\n      <th>quantity</th>\n      <th>item_name</th>\n      <th>choice_description</th>\n      <th>item_price</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>4</th>\n      <td>2</td>\n      <td>2</td>\n      <td>Chicken Bowl</td>\n      <td>[Tomatillo-Red Chili Salsa (Hot), [Black Beans...</td>\n      <td>$16.98</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>3</td>\n      <td>1</td>\n      <td>Chicken Bowl</td>\n      <td>[Fresh Tomato Salsa (Mild), [Rice, Cheese, Sou...</td>\n      <td>$10.98</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>6</td>\n      <td>1</td>\n      <td>Chicken Crispy Tacos</td>\n      <td>[Roasted Chili Corn Salsa, [Fajita Vegetables,...</td>\n      <td>$8.75</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>6</td>\n      <td>1</td>\n      <td>Chicken Soft Tacos</td>\n      <td>[Roasted Chili Corn Salsa, [Rice, Black Beans,...</td>\n      <td>$8.75</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>7</td>\n      <td>1</td>\n      <td>Chicken Bowl</td>\n      <td>[Fresh Tomato Salsa, [Fajita Vegetables, Rice,...</td>\n      <td>$11.25</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 44
    }
   ],
   "source": [
    "orders[orders.item_name.str.contains('Chicken')].head()  # Filtering data with string 'Chicken'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "   star_rating                     title content_rating   genre  duration  \\\n0          9.3  The Shawshank Redemption              R   Crime       142   \n1          9.2             The Godfather              R   Crime       175   \n2          9.1    The Godfather: Part II              R   Crime       200   \n3          9.0           The Dark Knight          PG-13  Action       152   \n\n                                         actors_list  \n0  [u&#39;Tim Robbins&#39;, u&#39;Morgan Freeman&#39;, u&#39;Bob Gunt...  \n1    [u&#39;Marlon Brando&#39;, u&#39;Al Pacino&#39;, u&#39;James Caan&#39;]  \n2  [u&#39;Al Pacino&#39;, u&#39;Robert De Niro&#39;, u&#39;Robert Duv...  \n3  [u&#39;Christian Bale&#39;, u&#39;Heath Ledger&#39;, u&#39;Aaron E...  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>star_rating</th>\n      <th>title</th>\n      <th>content_rating</th>\n      <th>genre</th>\n      <th>duration</th>\n      <th>actors_list</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>9.3</td>\n      <td>The Shawshank Redemption</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>142</td>\n      <td>[u'Tim Robbins', u'Morgan Freeman', u'Bob Gunt...</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>9.2</td>\n      <td>The Godfather</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>175</td>\n      <td>[u'Marlon Brando', u'Al Pacino', u'James Caan']</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>9.1</td>\n      <td>The Godfather: Part II</td>\n      <td>R</td>\n      <td>Crime</td>\n      <td>200</td>\n      <td>[u'Al Pacino', u'Robert De Niro', u'Robert Duv...</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>9.0</td>\n      <td>The Dark Knight</td>\n      <td>PG-13</td>\n      <td>Action</td>\n      <td>152</td>\n      <td>[u'Christian Bale', u'Heath Ledger', u'Aaron E...</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 45
    }
   ],
   "source": [
    "# create a DataFrame only containing movies with a high 'star_rating'\n",
    "top_movies = movies.loc[movies.star_rating >= 9, :]\n",
    "top_movies"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Handling Missing Values"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**What does \"NaN\" mean?**\n",
    "\n",
    "- \"NaN\" is not a string, rather it's a special value: **`numpy.nan`**.\n",
    "- It stands for \"Not a Number\" and indicates a **missing value**.\n",
    "- **`read_csv`** detects missing values (by default) when reading the file, and replaces them with this special value."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "       Colors Reported  Shape Reported   Time  Location\n18236             True           False  False     False\n18237             True           False  False     False\n18238             True            True  False     False\n18239            False           False  False     False\n18240             True           False  False     False",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>Time</th>\n      <th>Location</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>18236</th>\n      <td>True</td>\n      <td>False</td>\n      <td>False</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>18237</th>\n      <td>True</td>\n      <td>False</td>\n      <td>False</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>18238</th>\n      <td>True</td>\n      <td>True</td>\n      <td>False</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>18239</th>\n      <td>False</td>\n      <td>False</td>\n      <td>False</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <th>18240</th>\n      <td>True</td>\n      <td>False</td>\n      <td>False</td>\n      <td>False</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 46
    }
   ],
   "source": [
    "# 'isnull' returns a DataFrame of booleans (True if missing, False if not missing)\n",
    "\n",
    "ufo.isnull().tail()\n",
    "#ufo.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "       Colors Reported  Shape Reported  Time  Location\n18236            False            True  True      True\n18237            False            True  True      True\n18238            False           False  True      True\n18239             True            True  True      True\n18240            False            True  True      True",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>Time</th>\n      <th>Location</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>18236</th>\n      <td>False</td>\n      <td>True</td>\n      <td>True</td>\n      <td>True</td>\n    </tr>\n    <tr>\n      <th>18237</th>\n      <td>False</td>\n      <td>True</td>\n      <td>True</td>\n      <td>True</td>\n    </tr>\n    <tr>\n      <th>18238</th>\n      <td>False</td>\n      <td>False</td>\n      <td>True</td>\n      <td>True</td>\n    </tr>\n    <tr>\n      <th>18239</th>\n      <td>True</td>\n      <td>True</td>\n      <td>True</td>\n      <td>True</td>\n    </tr>\n    <tr>\n      <th>18240</th>\n      <td>False</td>\n      <td>True</td>\n      <td>True</td>\n      <td>True</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 47
    }
   ],
   "source": [
    "# 'nonnull' returns the opposite of 'isnull' (True if not missing, False if missing)\n",
    "\n",
    "ufo.notnull().tail()\n",
    "#ufo.notnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "    Colors Reported Shape Reported             Time Location\n21              NaN            NaN   8/15/1943 0:00      NaN\n22              NaN          LIGHT   8/15/1943 0:00      NaN\n204             NaN           DISK  7/15/1952 12:30      NaN\n241            BLUE           DISK   7/4/1953 14:00      NaN\n613             NaN           DISK   7/1/1960 12:00      NaN",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>Time</th>\n      <th>Location</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>21</th>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>8/15/1943 0:00</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>22</th>\n      <td>NaN</td>\n      <td>LIGHT</td>\n      <td>8/15/1943 0:00</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>204</th>\n      <td>NaN</td>\n      <td>DISK</td>\n      <td>7/15/1952 12:30</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>241</th>\n      <td>BLUE</td>\n      <td>DISK</td>\n      <td>7/4/1953 14:00</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>613</th>\n      <td>NaN</td>\n      <td>DISK</td>\n      <td>7/1/1960 12:00</td>\n      <td>NaN</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 51
    }
   ],
   "source": [
    "# use the 'isnull' Series method to filter the DataFrame rows\n",
    "\n",
    "ufo[ufo.Location.isnull()].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "      Colors Reported Shape Reported              Time          Location\n12                RED         SPHERE   6/30/1939 20:00        Belton, SC\n19                RED          OTHER   4/30/1943 23:00    Bering Sea, AK\n36                RED      FORMATION    7/10/1945 1:30    Portsmouth, VA\n44              GREEN         SPHERE   6/30/1946 19:00     Blairsden, CA\n82               BLUE        CHEVRON   7/15/1947 21:00      San Jose, CA\n...               ...            ...               ...               ...\n18213           GREEN       FIREBALL  12/28/2000 19:10      Pasadena, CA\n18216          ORANGE          LIGHT  12/29/2000 16:10  Garden Grove, CA\n18220            BLUE           DISK  12/29/2000 20:30   Shasta Lake, CA\n18233             RED        VARIOUS  12/31/2000 21:00     Anchorage, AK\n18239             RED          LIGHT  12/31/2000 23:45   Eagle River, WI\n\n[2486 rows x 4 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>Time</th>\n      <th>Location</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>12</th>\n      <td>RED</td>\n      <td>SPHERE</td>\n      <td>6/30/1939 20:00</td>\n      <td>Belton, SC</td>\n    </tr>\n    <tr>\n      <th>19</th>\n      <td>RED</td>\n      <td>OTHER</td>\n      <td>4/30/1943 23:00</td>\n      <td>Bering Sea, AK</td>\n    </tr>\n    <tr>\n      <th>36</th>\n      <td>RED</td>\n      <td>FORMATION</td>\n      <td>7/10/1945 1:30</td>\n      <td>Portsmouth, VA</td>\n    </tr>\n    <tr>\n      <th>44</th>\n      <td>GREEN</td>\n      <td>SPHERE</td>\n      <td>6/30/1946 19:00</td>\n      <td>Blairsden, CA</td>\n    </tr>\n    <tr>\n      <th>82</th>\n      <td>BLUE</td>\n      <td>CHEVRON</td>\n      <td>7/15/1947 21:00</td>\n      <td>San Jose, CA</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>18213</th>\n      <td>GREEN</td>\n      <td>FIREBALL</td>\n      <td>12/28/2000 19:10</td>\n      <td>Pasadena, CA</td>\n    </tr>\n    <tr>\n      <th>18216</th>\n      <td>ORANGE</td>\n      <td>LIGHT</td>\n      <td>12/29/2000 16:10</td>\n      <td>Garden Grove, CA</td>\n    </tr>\n    <tr>\n      <th>18220</th>\n      <td>BLUE</td>\n      <td>DISK</td>\n      <td>12/29/2000 20:30</td>\n      <td>Shasta Lake, CA</td>\n    </tr>\n    <tr>\n      <th>18233</th>\n      <td>RED</td>\n      <td>VARIOUS</td>\n      <td>12/31/2000 21:00</td>\n      <td>Anchorage, AK</td>\n    </tr>\n    <tr>\n      <th>18239</th>\n      <td>RED</td>\n      <td>LIGHT</td>\n      <td>12/31/2000 23:45</td>\n      <td>Eagle River, WI</td>\n    </tr>\n  </tbody>\n</table>\n<p>2486 rows × 4 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 52
    }
   ],
   "source": [
    "ufo.dropna(how='any')          # if 'any' values are missing in a row, then drop that row\n",
    "#ufo.dropna(how='any').shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "      Colors Reported Shape Reported              Time  \\\n0                 NaN       TRIANGLE    6/1/1930 22:00   \n1                 NaN          OTHER   6/30/1930 20:00   \n2                 NaN           OVAL   2/15/1931 14:00   \n3                 NaN           DISK    6/1/1931 13:00   \n4                 NaN          LIGHT   4/18/1933 19:00   \n...               ...            ...               ...   \n18236             NaN       TRIANGLE  12/31/2000 23:00   \n18237             NaN           DISK  12/31/2000 23:00   \n18238             NaN            NaN  12/31/2000 23:45   \n18239             RED          LIGHT  12/31/2000 23:45   \n18240             NaN           OVAL  12/31/2000 23:59   \n\n                       Location  \n0                    Ithaca, NY  \n1               Willingboro, NJ  \n2                   Holyoke, CO  \n3                   Abilene, KS  \n4      New York Worlds Fair, NY  \n...                         ...  \n18236            Grant Park, IL  \n18237           Spirit Lake, IA  \n18238           Eagle River, WI  \n18239           Eagle River, WI  \n18240                  Ybor, FL  \n\n[18241 rows x 4 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Colors Reported</th>\n      <th>Shape Reported</th>\n      <th>Time</th>\n      <th>Location</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>6/1/1930 22:00</td>\n      <td>Ithaca, NY</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>NaN</td>\n      <td>OTHER</td>\n      <td>6/30/1930 20:00</td>\n      <td>Willingboro, NJ</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>NaN</td>\n      <td>OVAL</td>\n      <td>2/15/1931 14:00</td>\n      <td>Holyoke, CO</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>NaN</td>\n      <td>DISK</td>\n      <td>6/1/1931 13:00</td>\n      <td>Abilene, KS</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>NaN</td>\n      <td>LIGHT</td>\n      <td>4/18/1933 19:00</td>\n      <td>New York Worlds Fair, NY</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>18236</th>\n      <td>NaN</td>\n      <td>TRIANGLE</td>\n      <td>12/31/2000 23:00</td>\n      <td>Grant Park, IL</td>\n    </tr>\n    <tr>\n      <th>18237</th>\n      <td>NaN</td>\n      <td>DISK</td>\n      <td>12/31/2000 23:00</td>\n      <td>Spirit Lake, IA</td>\n    </tr>\n    <tr>\n      <th>18238</th>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>12/31/2000 23:45</td>\n      <td>Eagle River, WI</td>\n    </tr>\n    <tr>\n      <th>18239</th>\n      <td>RED</td>\n      <td>LIGHT</td>\n      <td>12/31/2000 23:45</td>\n      <td>Eagle River, WI</td>\n    </tr>\n    <tr>\n      <th>18240</th>\n      <td>NaN</td>\n      <td>OVAL</td>\n      <td>12/31/2000 23:59</td>\n      <td>Ybor, FL</td>\n    </tr>\n  </tbody>\n</table>\n<p>18241 rows × 4 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 53
    }
   ],
   "source": [
    "ufo.dropna(how='all')       # if 'all' values are missing in a row, then drop that row (none are dropped in this case)\n",
    "#ufo.dropna(how='all').shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "(15576, 4)"
     },
     "metadata": {},
     "execution_count": 55
    }
   ],
   "source": [
    "# if 'any' values are missing in a row (considering only 'City' and 'Shape Reported'), then drop that row\n",
    "\n",
    "ufo.dropna(subset=['Location', 'Shape Reported'], how='any').shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "(18237, 4)"
     },
     "metadata": {},
     "execution_count": 56
    }
   ],
   "source": [
    "# if 'all' values are missing in a row (considering only 'City' and 'Shape Reported'), then drop that row\n",
    "\n",
    "ufo.dropna(subset=['Location', 'Shape Reported'], how='all').shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "LIGHT        2803\nDISK         2122\nTRIANGLE     1889\nOTHER        1402\nCIRCLE       1365\nSPHERE       1054\nFIREBALL     1039\nOVAL          845\nCIGAR         617\nFORMATION     434\nVARIOUS       333\nRECTANGLE     303\nCYLINDER      294\nCHEVRON       248\nDIAMOND       234\nEGG           197\nFLASH         188\nTEARDROP      119\nCONE           60\nCROSS          36\nDELTA           7\nROUND           2\nCRESCENT        2\nDOME            1\nPYRAMID         1\nHEXAGON         1\nFLARE           1\nName: Shape Reported, dtype: int64"
     },
     "metadata": {},
     "execution_count": 57
    }
   ],
   "source": [
    "ufo['Shape Reported'].value_counts()               # 'value_counts' does not include missing values by default\n",
    "#ufo['Shape Reported'].value_counts(dropna=False)   # explicitly include missing values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "VARIOUS     2977\nLIGHT       2803\nDISK        2122\nTRIANGLE    1889\nOTHER       1402\nName: Shape Reported, dtype: int64"
     },
     "metadata": {},
     "execution_count": 59
    }
   ],
   "source": [
    "ufo['Shape Reported'].fillna(value='VARIOUS', inplace=True)   # fill in missing values with a specified value\n",
    "ufo['Shape Reported'].value_counts().head()                   # confirm that the missing values were filled in"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Groupby Methods\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "               count        mean        std   min     25%    50%     75%  \\\ncontinent                                                                  \nAfrica          53.0   61.471698  80.557816   0.0   15.00   32.0   76.00   \nAsia            44.0   37.045455  49.469725   0.0    4.25   17.5   60.50   \nEurope          45.0  193.777778  99.631569   0.0  127.00  219.0  270.00   \nNorth America   23.0  145.434783  79.621163   1.0   80.00  143.0  198.00   \nOceania         16.0   89.687500  96.641412   0.0   21.00   52.5  125.75   \nSouth America   12.0  175.083333  65.242845  93.0  129.50  162.5  198.00   \n\n                 max  \ncontinent             \nAfrica         376.0  \nAsia           247.0  \nEurope         361.0  \nNorth America  285.0  \nOceania        306.0  \nSouth America  333.0  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>count</th>\n      <th>mean</th>\n      <th>std</th>\n      <th>min</th>\n      <th>25%</th>\n      <th>50%</th>\n      <th>75%</th>\n      <th>max</th>\n    </tr>\n    <tr>\n      <th>continent</th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>Africa</th>\n      <td>53.0</td>\n      <td>61.471698</td>\n      <td>80.557816</td>\n      <td>0.0</td>\n      <td>15.00</td>\n      <td>32.0</td>\n      <td>76.00</td>\n      <td>376.0</td>\n    </tr>\n    <tr>\n      <th>Asia</th>\n      <td>44.0</td>\n      <td>37.045455</td>\n      <td>49.469725</td>\n      <td>0.0</td>\n      <td>4.25</td>\n      <td>17.5</td>\n      <td>60.50</td>\n      <td>247.0</td>\n    </tr>\n    <tr>\n      <th>Europe</th>\n      <td>45.0</td>\n      <td>193.777778</td>\n      <td>99.631569</td>\n      <td>0.0</td>\n      <td>127.00</td>\n      <td>219.0</td>\n      <td>270.00</td>\n      <td>361.0</td>\n    </tr>\n    <tr>\n      <th>North America</th>\n      <td>23.0</td>\n      <td>145.434783</td>\n      <td>79.621163</td>\n      <td>1.0</td>\n      <td>80.00</td>\n      <td>143.0</td>\n      <td>198.00</td>\n      <td>285.0</td>\n    </tr>\n    <tr>\n      <th>Oceania</th>\n      <td>16.0</td>\n      <td>89.687500</td>\n      <td>96.641412</td>\n      <td>0.0</td>\n      <td>21.00</td>\n      <td>52.5</td>\n      <td>125.75</td>\n      <td>306.0</td>\n    </tr>\n    <tr>\n      <th>South America</th>\n      <td>12.0</td>\n      <td>175.083333</td>\n      <td>65.242845</td>\n      <td>93.0</td>\n      <td>129.50</td>\n      <td>162.5</td>\n      <td>198.00</td>\n      <td>333.0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 60
    }
   ],
   "source": [
    "# calculate the mean beer servings for each continent\n",
    "drinks.groupby('continent').describe()['beer_servings']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "continent\nAfrica           376\nAsia             247\nEurope           361\nNorth America    285\nOceania          306\nSouth America    333\nName: beer_servings, dtype: int64"
     },
     "metadata": {},
     "execution_count": 61
    }
   ],
   "source": [
    "# other aggregation functions (such as 'max') can also be used with groupby\n",
    "drinks.groupby('continent').beer_servings.max()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "&lt;matplotlib.axes._subplots.AxesSubplot at 0x7fe476605100&gt;"
     },
     "metadata": {},
     "execution_count": 63
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": "&lt;Figure size 432x288 with 1 Axes&gt;",
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"326.103224pt\" version=\"1.1\" viewBox=\"0 0 375.2875 326.103224\" width=\"375.2875pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <defs>\n  <style type=\"text/css\">\n*{stroke-linecap:butt;stroke-linejoin:round;}\n  </style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 326.103224 \nL 375.2875 326.103224 \nL 375.2875 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 33.2875 224.734474 \nL 368.0875 224.734474 \nL 368.0875 7.294474 \nL 33.2875 7.294474 \nz\n\" style=\"fill:#ffffff;\"/>\n   </g>\n   <g id=\"patch_3\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 47.2375 224.734474 \nL 54.2125 224.734474 \nL 54.2125 159.041129 \nL 47.2375 159.041129 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 103.0375 224.734474 \nL 110.0125 224.734474 \nL 110.0125 185.144876 \nL 103.0375 185.144876 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 158.8375 224.734474 \nL 165.8125 224.734474 \nL 165.8125 17.64876 \nL 158.8375 17.64876 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 214.6375 224.734474 \nL 221.6125 224.734474 \nL 221.6125 69.311772 \nL 214.6375 69.311772 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_7\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 270.4375 224.734474 \nL 277.4125 224.734474 \nL 277.4125 128.887571 \nL 270.4375 128.887571 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_8\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 326.2375 224.734474 \nL 333.2125 224.734474 \nL 333.2125 37.627069 \nL 326.2375 37.627069 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_9\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 54.2125 224.734474 \nL 61.1875 224.734474 \nL 61.1875 207.272707 \nL 54.2125 207.272707 \nz\n\" style=\"fill:#ff7f0e;\"/>\n   </g>\n   <g id=\"patch_10\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 110.0125 224.734474 \nL 116.9875 224.734474 \nL 116.9875 159.715238 \nL 110.0125 159.715238 \nz\n\" style=\"fill:#ff7f0e;\"/>\n   </g>\n   <g id=\"patch_11\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 165.8125 224.734474 \nL 172.7875 224.734474 \nL 172.7875 83.075497 \nL 165.8125 83.075497 \nz\n\" style=\"fill:#ff7f0e;\"/>\n   </g>\n   <g id=\"patch_12\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 221.6125 224.734474 \nL 228.5875 224.734474 \nL 228.5875 47.612997 \nL 221.6125 47.612997 \nz\n\" style=\"fill:#ff7f0e;\"/>\n   </g>\n   <g id=\"patch_13\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 277.4125 224.734474 \nL 284.3875 224.734474 \nL 284.3875 162.283704 \nL 277.4125 162.283704 \nz\n\" style=\"fill:#ff7f0e;\"/>\n   </g>\n   <g id=\"patch_14\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 333.2125 224.734474 \nL 340.1875 224.734474 \nL 340.1875 102.103871 \nL 333.2125 102.103871 \nz\n\" style=\"fill:#ff7f0e;\"/>\n   </g>\n   <g id=\"patch_15\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 61.1875 224.734474 \nL 68.1625 224.734474 \nL 68.1625 207.353362 \nL 61.1875 207.353362 \nz\n\" style=\"fill:#2ca02c;\"/>\n   </g>\n   <g id=\"patch_16\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 116.9875 224.734474 \nL 123.9625 224.734474 \nL 123.9625 215.043524 \nL 116.9875 215.043524 \nz\n\" style=\"fill:#2ca02c;\"/>\n   </g>\n   <g id=\"patch_17\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 172.7875 224.734474 \nL 179.7625 224.734474 \nL 179.7625 72.744959 \nL 172.7875 72.744959 \nz\n\" style=\"fill:#2ca02c;\"/>\n   </g>\n   <g id=\"patch_18\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 228.5875 224.734474 \nL 235.5625 224.734474 \nL 235.5625 198.528673 \nL 228.5875 198.528673 \nz\n\" style=\"fill:#2ca02c;\"/>\n   </g>\n   <g id=\"patch_19\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 284.3875 224.734474 \nL 291.3625 224.734474 \nL 291.3625 186.662882 \nL 284.3875 186.662882 \nz\n\" style=\"fill:#2ca02c;\"/>\n   </g>\n   <g id=\"patch_20\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 340.1875 224.734474 \nL 347.1625 224.734474 \nL 347.1625 158.031263 \nL 340.1875 158.031263 \nz\n\" style=\"fill:#2ca02c;\"/>\n   </g>\n   <g id=\"patch_21\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 68.1625 224.734474 \nL 75.1375 224.734474 \nL 75.1375 221.52038 \nL 68.1625 221.52038 \nz\n\" style=\"fill:#d62728;\"/>\n   </g>\n   <g id=\"patch_22\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 123.9625 224.734474 \nL 130.9375 224.734474 \nL 130.9375 222.414961 \nL 123.9625 222.414961 \nz\n\" style=\"fill:#d62728;\"/>\n   </g>\n   <g id=\"patch_23\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 179.7625 224.734474 \nL 186.7375 224.734474 \nL 186.7375 215.52486 \nL 179.7625 215.52486 \nz\n\" style=\"fill:#d62728;\"/>\n   </g>\n   <g id=\"patch_24\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 235.5625 224.734474 \nL 242.5375 224.734474 \nL 242.5375 218.327063 \nL 235.5625 218.327063 \nz\n\" style=\"fill:#d62728;\"/>\n   </g>\n   <g id=\"patch_25\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 291.3625 224.734474 \nL 298.3375 224.734474 \nL 298.3375 221.121013 \nL 291.3625 221.121013 \nz\n\" style=\"fill:#d62728;\"/>\n   </g>\n   <g id=\"patch_26\">\n    <path clip-path=\"url(#p95d6e00bdf)\" d=\"M 347.1625 224.734474 \nL 354.1375 224.734474 \nL 354.1375 217.992908 \nL 347.1625 217.992908 \nz\n\" style=\"fill:#d62728;\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <defs>\n       <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"m36b3899efc\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"61.1875\" xlink:href=\"#m36b3899efc\" y=\"224.734474\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- Africa -->\n      <defs>\n       <path d=\"M 34.1875 63.1875 \nL 20.796875 26.90625 \nL 47.609375 26.90625 \nz\nM 28.609375 72.90625 \nL 39.796875 72.90625 \nL 67.578125 0 \nL 57.328125 0 \nL 50.6875 18.703125 \nL 17.828125 18.703125 \nL 11.1875 0 \nL 0.78125 0 \nz\n\" id=\"DejaVuSans-65\"/>\n       <path d=\"M 37.109375 75.984375 \nL 37.109375 68.5 \nL 28.515625 68.5 \nQ 23.6875 68.5 21.796875 66.546875 \nQ 19.921875 64.59375 19.921875 59.515625 \nL 19.921875 54.6875 \nL 34.71875 54.6875 \nL 34.71875 47.703125 \nL 19.921875 47.703125 \nL 19.921875 0 \nL 10.890625 0 \nL 10.890625 47.703125 \nL 2.296875 47.703125 \nL 2.296875 54.6875 \nL 10.890625 54.6875 \nL 10.890625 58.5 \nQ 10.890625 67.625 15.140625 71.796875 \nQ 19.390625 75.984375 28.609375 75.984375 \nz\n\" id=\"DejaVuSans-102\"/>\n       <path d=\"M 41.109375 46.296875 \nQ 39.59375 47.171875 37.8125 47.578125 \nQ 36.03125 48 33.890625 48 \nQ 26.265625 48 22.1875 43.046875 \nQ 18.109375 38.09375 18.109375 28.8125 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 20.953125 51.171875 25.484375 53.578125 \nQ 30.03125 56 36.53125 56 \nQ 37.453125 56 38.578125 55.875 \nQ 39.703125 55.765625 41.0625 55.515625 \nz\n\" id=\"DejaVuSans-114\"/>\n       <path d=\"M 9.421875 54.6875 \nL 18.40625 54.6875 \nL 18.40625 0 \nL 9.421875 0 \nz\nM 9.421875 75.984375 \nL 18.40625 75.984375 \nL 18.40625 64.59375 \nL 9.421875 64.59375 \nz\n\" id=\"DejaVuSans-105\"/>\n       <path d=\"M 48.78125 52.59375 \nL 48.78125 44.1875 \nQ 44.96875 46.296875 41.140625 47.34375 \nQ 37.3125 48.390625 33.40625 48.390625 \nQ 24.65625 48.390625 19.8125 42.84375 \nQ 14.984375 37.3125 14.984375 27.296875 \nQ 14.984375 17.28125 19.8125 11.734375 \nQ 24.65625 6.203125 33.40625 6.203125 \nQ 37.3125 6.203125 41.140625 7.25 \nQ 44.96875 8.296875 48.78125 10.40625 \nL 48.78125 2.09375 \nQ 45.015625 0.34375 40.984375 -0.53125 \nQ 36.96875 -1.421875 32.421875 -1.421875 \nQ 20.0625 -1.421875 12.78125 6.34375 \nQ 5.515625 14.109375 5.515625 27.296875 \nQ 5.515625 40.671875 12.859375 48.328125 \nQ 20.21875 56 33.015625 56 \nQ 37.15625 56 41.109375 55.140625 \nQ 45.0625 54.296875 48.78125 52.59375 \nz\n\" id=\"DejaVuSans-99\"/>\n       <path d=\"M 34.28125 27.484375 \nQ 23.390625 27.484375 19.1875 25 \nQ 14.984375 22.515625 14.984375 16.5 \nQ 14.984375 11.71875 18.140625 8.90625 \nQ 21.296875 6.109375 26.703125 6.109375 \nQ 34.1875 6.109375 38.703125 11.40625 \nQ 43.21875 16.703125 43.21875 25.484375 \nL 43.21875 27.484375 \nz\nM 52.203125 31.203125 \nL 52.203125 0 \nL 43.21875 0 \nL 43.21875 8.296875 \nQ 40.140625 3.328125 35.546875 0.953125 \nQ 30.953125 -1.421875 24.3125 -1.421875 \nQ 15.921875 -1.421875 10.953125 3.296875 \nQ 6 8.015625 6 15.921875 \nQ 6 25.140625 12.171875 29.828125 \nQ 18.359375 34.515625 30.609375 34.515625 \nL 43.21875 34.515625 \nL 43.21875 35.40625 \nQ 43.21875 41.609375 39.140625 45 \nQ 35.0625 48.390625 27.6875 48.390625 \nQ 23 48.390625 18.546875 47.265625 \nQ 14.109375 46.140625 10.015625 43.890625 \nL 10.015625 52.203125 \nQ 14.9375 54.109375 19.578125 55.046875 \nQ 24.21875 56 28.609375 56 \nQ 40.484375 56 46.34375 49.84375 \nQ 52.203125 43.703125 52.203125 31.203125 \nz\n\" id=\"DejaVuSans-97\"/>\n      </defs>\n      <g transform=\"translate(63.946875 260.248537)rotate(-90)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-65\"/>\n       <use x=\"64.783203\" xlink:href=\"#DejaVuSans-102\"/>\n       <use x=\"99.988281\" xlink:href=\"#DejaVuSans-114\"/>\n       <use x=\"141.101562\" xlink:href=\"#DejaVuSans-105\"/>\n       <use x=\"168.884766\" xlink:href=\"#DejaVuSans-99\"/>\n       <use x=\"223.865234\" xlink:href=\"#DejaVuSans-97\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_2\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"116.9875\" xlink:href=\"#m36b3899efc\" y=\"224.734474\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- Asia -->\n      <defs>\n       <path d=\"M 44.28125 53.078125 \nL 44.28125 44.578125 \nQ 40.484375 46.53125 36.375 47.5 \nQ 32.28125 48.484375 27.875 48.484375 \nQ 21.1875 48.484375 17.84375 46.4375 \nQ 14.5 44.390625 14.5 40.28125 \nQ 14.5 37.15625 16.890625 35.375 \nQ 19.28125 33.59375 26.515625 31.984375 \nL 29.59375 31.296875 \nQ 39.15625 29.25 43.1875 25.515625 \nQ 47.21875 21.78125 47.21875 15.09375 \nQ 47.21875 7.46875 41.1875 3.015625 \nQ 35.15625 -1.421875 24.609375 -1.421875 \nQ 20.21875 -1.421875 15.453125 -0.5625 \nQ 10.6875 0.296875 5.421875 2 \nL 5.421875 11.28125 \nQ 10.40625 8.6875 15.234375 7.390625 \nQ 20.0625 6.109375 24.8125 6.109375 \nQ 31.15625 6.109375 34.5625 8.28125 \nQ 37.984375 10.453125 37.984375 14.40625 \nQ 37.984375 18.0625 35.515625 20.015625 \nQ 33.0625 21.96875 24.703125 23.78125 \nL 21.578125 24.515625 \nQ 13.234375 26.265625 9.515625 29.90625 \nQ 5.8125 33.546875 5.8125 39.890625 \nQ 5.8125 47.609375 11.28125 51.796875 \nQ 16.75 56 26.8125 56 \nQ 31.78125 56 36.171875 55.265625 \nQ 40.578125 54.546875 44.28125 53.078125 \nz\n\" id=\"DejaVuSans-115\"/>\n      </defs>\n      <g transform=\"translate(119.746875 252.690724)rotate(-90)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-65\"/>\n       <use x=\"68.408203\" xlink:href=\"#DejaVuSans-115\"/>\n       <use x=\"120.507812\" xlink:href=\"#DejaVuSans-105\"/>\n       <use x=\"148.291016\" xlink:href=\"#DejaVuSans-97\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_3\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"172.7875\" xlink:href=\"#m36b3899efc\" y=\"224.734474\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- Europe -->\n      <defs>\n       <path d=\"M 9.8125 72.90625 \nL 55.90625 72.90625 \nL 55.90625 64.59375 \nL 19.671875 64.59375 \nL 19.671875 43.015625 \nL 54.390625 43.015625 \nL 54.390625 34.71875 \nL 19.671875 34.71875 \nL 19.671875 8.296875 \nL 56.78125 8.296875 \nL 56.78125 0 \nL 9.8125 0 \nz\n\" id=\"DejaVuSans-69\"/>\n       <path d=\"M 8.5 21.578125 \nL 8.5 54.6875 \nL 17.484375 54.6875 \nL 17.484375 21.921875 \nQ 17.484375 14.15625 20.5 10.265625 \nQ 23.53125 6.390625 29.59375 6.390625 \nQ 36.859375 6.390625 41.078125 11.03125 \nQ 45.3125 15.671875 45.3125 23.6875 \nL 45.3125 54.6875 \nL 54.296875 54.6875 \nL 54.296875 0 \nL 45.3125 0 \nL 45.3125 8.40625 \nQ 42.046875 3.421875 37.71875 1 \nQ 33.40625 -1.421875 27.6875 -1.421875 \nQ 18.265625 -1.421875 13.375 4.4375 \nQ 8.5 10.296875 8.5 21.578125 \nz\nM 31.109375 56 \nz\n\" id=\"DejaVuSans-117\"/>\n       <path d=\"M 30.609375 48.390625 \nQ 23.390625 48.390625 19.1875 42.75 \nQ 14.984375 37.109375 14.984375 27.296875 \nQ 14.984375 17.484375 19.15625 11.84375 \nQ 23.34375 6.203125 30.609375 6.203125 \nQ 37.796875 6.203125 41.984375 11.859375 \nQ 46.1875 17.53125 46.1875 27.296875 \nQ 46.1875 37.015625 41.984375 42.703125 \nQ 37.796875 48.390625 30.609375 48.390625 \nz\nM 30.609375 56 \nQ 42.328125 56 49.015625 48.375 \nQ 55.71875 40.765625 55.71875 27.296875 \nQ 55.71875 13.875 49.015625 6.21875 \nQ 42.328125 -1.421875 30.609375 -1.421875 \nQ 18.84375 -1.421875 12.171875 6.21875 \nQ 5.515625 13.875 5.515625 27.296875 \nQ 5.515625 40.765625 12.171875 48.375 \nQ 18.84375 56 30.609375 56 \nz\n\" id=\"DejaVuSans-111\"/>\n       <path d=\"M 18.109375 8.203125 \nL 18.109375 -20.796875 \nL 9.078125 -20.796875 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.390625 \nQ 20.953125 51.265625 25.265625 53.625 \nQ 29.59375 56 35.59375 56 \nQ 45.5625 56 51.78125 48.09375 \nQ 58.015625 40.1875 58.015625 27.296875 \nQ 58.015625 14.40625 51.78125 6.484375 \nQ 45.5625 -1.421875 35.59375 -1.421875 \nQ 29.59375 -1.421875 25.265625 0.953125 \nQ 20.953125 3.328125 18.109375 8.203125 \nz\nM 48.6875 27.296875 \nQ 48.6875 37.203125 44.609375 42.84375 \nQ 40.53125 48.484375 33.40625 48.484375 \nQ 26.265625 48.484375 22.1875 42.84375 \nQ 18.109375 37.203125 18.109375 27.296875 \nQ 18.109375 17.390625 22.1875 11.75 \nQ 26.265625 6.109375 33.40625 6.109375 \nQ 40.53125 6.109375 44.609375 11.75 \nQ 48.6875 17.390625 48.6875 27.296875 \nz\n\" id=\"DejaVuSans-112\"/>\n       <path d=\"M 56.203125 29.59375 \nL 56.203125 25.203125 \nL 14.890625 25.203125 \nQ 15.484375 15.921875 20.484375 11.0625 \nQ 25.484375 6.203125 34.421875 6.203125 \nQ 39.59375 6.203125 44.453125 7.46875 \nQ 49.3125 8.734375 54.109375 11.28125 \nL 54.109375 2.78125 \nQ 49.265625 0.734375 44.1875 -0.34375 \nQ 39.109375 -1.421875 33.890625 -1.421875 \nQ 20.796875 -1.421875 13.15625 6.1875 \nQ 5.515625 13.8125 5.515625 26.8125 \nQ 5.515625 40.234375 12.765625 48.109375 \nQ 20.015625 56 32.328125 56 \nQ 43.359375 56 49.78125 48.890625 \nQ 56.203125 41.796875 56.203125 29.59375 \nz\nM 47.21875 32.234375 \nQ 47.125 39.59375 43.09375 43.984375 \nQ 39.0625 48.390625 32.421875 48.390625 \nQ 24.90625 48.390625 20.390625 44.140625 \nQ 15.875 39.890625 15.1875 32.171875 \nz\n\" id=\"DejaVuSans-101\"/>\n      </defs>\n      <g transform=\"translate(175.546875 266.896974)rotate(-90)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-69\"/>\n       <use x=\"63.183594\" xlink:href=\"#DejaVuSans-117\"/>\n       <use x=\"126.5625\" xlink:href=\"#DejaVuSans-114\"/>\n       <use x=\"165.425781\" xlink:href=\"#DejaVuSans-111\"/>\n       <use x=\"226.607422\" xlink:href=\"#DejaVuSans-112\"/>\n       <use x=\"290.083984\" xlink:href=\"#DejaVuSans-101\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_4\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"228.5875\" xlink:href=\"#m36b3899efc\" y=\"224.734474\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- North America -->\n      <defs>\n       <path d=\"M 9.8125 72.90625 \nL 23.09375 72.90625 \nL 55.421875 11.921875 \nL 55.421875 72.90625 \nL 64.984375 72.90625 \nL 64.984375 0 \nL 51.703125 0 \nL 19.390625 60.984375 \nL 19.390625 0 \nL 9.8125 0 \nz\n\" id=\"DejaVuSans-78\"/>\n       <path d=\"M 18.3125 70.21875 \nL 18.3125 54.6875 \nL 36.8125 54.6875 \nL 36.8125 47.703125 \nL 18.3125 47.703125 \nL 18.3125 18.015625 \nQ 18.3125 11.328125 20.140625 9.421875 \nQ 21.96875 7.515625 27.59375 7.515625 \nL 36.8125 7.515625 \nL 36.8125 0 \nL 27.59375 0 \nQ 17.1875 0 13.234375 3.875 \nQ 9.28125 7.765625 9.28125 18.015625 \nL 9.28125 47.703125 \nL 2.6875 47.703125 \nL 2.6875 54.6875 \nL 9.28125 54.6875 \nL 9.28125 70.21875 \nz\n\" id=\"DejaVuSans-116\"/>\n       <path d=\"M 54.890625 33.015625 \nL 54.890625 0 \nL 45.90625 0 \nL 45.90625 32.71875 \nQ 45.90625 40.484375 42.875 44.328125 \nQ 39.84375 48.1875 33.796875 48.1875 \nQ 26.515625 48.1875 22.3125 43.546875 \nQ 18.109375 38.921875 18.109375 30.90625 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 75.984375 \nL 18.109375 75.984375 \nL 18.109375 46.1875 \nQ 21.34375 51.125 25.703125 53.5625 \nQ 30.078125 56 35.796875 56 \nQ 45.21875 56 50.046875 50.171875 \nQ 54.890625 44.34375 54.890625 33.015625 \nz\n\" id=\"DejaVuSans-104\"/>\n       <path id=\"DejaVuSans-32\"/>\n       <path d=\"M 52 44.1875 \nQ 55.375 50.25 60.0625 53.125 \nQ 64.75 56 71.09375 56 \nQ 79.640625 56 84.28125 50.015625 \nQ 88.921875 44.046875 88.921875 33.015625 \nL 88.921875 0 \nL 79.890625 0 \nL 79.890625 32.71875 \nQ 79.890625 40.578125 77.09375 44.375 \nQ 74.3125 48.1875 68.609375 48.1875 \nQ 61.625 48.1875 57.5625 43.546875 \nQ 53.515625 38.921875 53.515625 30.90625 \nL 53.515625 0 \nL 44.484375 0 \nL 44.484375 32.71875 \nQ 44.484375 40.625 41.703125 44.40625 \nQ 38.921875 48.1875 33.109375 48.1875 \nQ 26.21875 48.1875 22.15625 43.53125 \nQ 18.109375 38.875 18.109375 30.90625 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 21.1875 51.21875 25.484375 53.609375 \nQ 29.78125 56 35.6875 56 \nQ 41.65625 56 45.828125 52.96875 \nQ 50 49.953125 52 44.1875 \nz\n\" id=\"DejaVuSans-109\"/>\n      </defs>\n      <g transform=\"translate(231.346875 304.131349)rotate(-90)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-78\"/>\n       <use x=\"74.804688\" xlink:href=\"#DejaVuSans-111\"/>\n       <use x=\"135.986328\" xlink:href=\"#DejaVuSans-114\"/>\n       <use x=\"177.099609\" xlink:href=\"#DejaVuSans-116\"/>\n       <use x=\"216.308594\" xlink:href=\"#DejaVuSans-104\"/>\n       <use x=\"279.6875\" xlink:href=\"#DejaVuSans-32\"/>\n       <use x=\"311.474609\" xlink:href=\"#DejaVuSans-65\"/>\n       <use x=\"379.882812\" xlink:href=\"#DejaVuSans-109\"/>\n       <use x=\"477.294922\" xlink:href=\"#DejaVuSans-101\"/>\n       <use x=\"538.818359\" xlink:href=\"#DejaVuSans-114\"/>\n       <use x=\"579.931641\" xlink:href=\"#DejaVuSans-105\"/>\n       <use x=\"607.714844\" xlink:href=\"#DejaVuSans-99\"/>\n       <use x=\"662.695312\" xlink:href=\"#DejaVuSans-97\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_5\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"284.3875\" xlink:href=\"#m36b3899efc\" y=\"224.734474\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- Oceania -->\n      <defs>\n       <path d=\"M 39.40625 66.21875 \nQ 28.65625 66.21875 22.328125 58.203125 \nQ 16.015625 50.203125 16.015625 36.375 \nQ 16.015625 22.609375 22.328125 14.59375 \nQ 28.65625 6.59375 39.40625 6.59375 \nQ 50.140625 6.59375 56.421875 14.59375 \nQ 62.703125 22.609375 62.703125 36.375 \nQ 62.703125 50.203125 56.421875 58.203125 \nQ 50.140625 66.21875 39.40625 66.21875 \nz\nM 39.40625 74.21875 \nQ 54.734375 74.21875 63.90625 63.9375 \nQ 73.09375 53.65625 73.09375 36.375 \nQ 73.09375 19.140625 63.90625 8.859375 \nQ 54.734375 -1.421875 39.40625 -1.421875 \nQ 24.03125 -1.421875 14.8125 8.828125 \nQ 5.609375 19.09375 5.609375 36.375 \nQ 5.609375 53.65625 14.8125 63.9375 \nQ 24.03125 74.21875 39.40625 74.21875 \nz\n\" id=\"DejaVuSans-79\"/>\n       <path d=\"M 54.890625 33.015625 \nL 54.890625 0 \nL 45.90625 0 \nL 45.90625 32.71875 \nQ 45.90625 40.484375 42.875 44.328125 \nQ 39.84375 48.1875 33.796875 48.1875 \nQ 26.515625 48.1875 22.3125 43.546875 \nQ 18.109375 38.921875 18.109375 30.90625 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 54.6875 \nL 18.109375 54.6875 \nL 18.109375 46.1875 \nQ 21.34375 51.125 25.703125 53.5625 \nQ 30.078125 56 35.796875 56 \nQ 45.21875 56 50.046875 50.171875 \nQ 54.890625 44.34375 54.890625 33.015625 \nz\n\" id=\"DejaVuSans-110\"/>\n      </defs>\n      <g transform=\"translate(287.146875 272.629787)rotate(-90)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-79\"/>\n       <use x=\"78.710938\" xlink:href=\"#DejaVuSans-99\"/>\n       <use x=\"133.691406\" xlink:href=\"#DejaVuSans-101\"/>\n       <use x=\"195.214844\" xlink:href=\"#DejaVuSans-97\"/>\n       <use x=\"256.494141\" xlink:href=\"#DejaVuSans-110\"/>\n       <use x=\"319.873047\" xlink:href=\"#DejaVuSans-105\"/>\n       <use x=\"347.65625\" xlink:href=\"#DejaVuSans-97\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_6\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"340.1875\" xlink:href=\"#m36b3899efc\" y=\"224.734474\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- South America -->\n      <defs>\n       <path d=\"M 53.515625 70.515625 \nL 53.515625 60.890625 \nQ 47.90625 63.578125 42.921875 64.890625 \nQ 37.9375 66.21875 33.296875 66.21875 \nQ 25.25 66.21875 20.875 63.09375 \nQ 16.5 59.96875 16.5 54.203125 \nQ 16.5 49.359375 19.40625 46.890625 \nQ 22.3125 44.4375 30.421875 42.921875 \nL 36.375 41.703125 \nQ 47.40625 39.59375 52.65625 34.296875 \nQ 57.90625 29 57.90625 20.125 \nQ 57.90625 9.515625 50.796875 4.046875 \nQ 43.703125 -1.421875 29.984375 -1.421875 \nQ 24.8125 -1.421875 18.96875 -0.25 \nQ 13.140625 0.921875 6.890625 3.21875 \nL 6.890625 13.375 \nQ 12.890625 10.015625 18.65625 8.296875 \nQ 24.421875 6.59375 29.984375 6.59375 \nQ 38.421875 6.59375 43.015625 9.90625 \nQ 47.609375 13.234375 47.609375 19.390625 \nQ 47.609375 24.75 44.3125 27.78125 \nQ 41.015625 30.8125 33.5 32.328125 \nL 27.484375 33.5 \nQ 16.453125 35.6875 11.515625 40.375 \nQ 6.59375 45.0625 6.59375 53.421875 \nQ 6.59375 63.09375 13.40625 68.65625 \nQ 20.21875 74.21875 32.171875 74.21875 \nQ 37.3125 74.21875 42.625 73.28125 \nQ 47.953125 72.359375 53.515625 70.515625 \nz\n\" id=\"DejaVuSans-83\"/>\n      </defs>\n      <g transform=\"translate(342.946875 305.225099)rotate(-90)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-83\"/>\n       <use x=\"63.476562\" xlink:href=\"#DejaVuSans-111\"/>\n       <use x=\"124.658203\" xlink:href=\"#DejaVuSans-117\"/>\n       <use x=\"188.037109\" xlink:href=\"#DejaVuSans-116\"/>\n       <use x=\"227.246094\" xlink:href=\"#DejaVuSans-104\"/>\n       <use x=\"290.625\" xlink:href=\"#DejaVuSans-32\"/>\n       <use x=\"322.412109\" xlink:href=\"#DejaVuSans-65\"/>\n       <use x=\"390.820312\" xlink:href=\"#DejaVuSans-109\"/>\n       <use x=\"488.232422\" xlink:href=\"#DejaVuSans-101\"/>\n       <use x=\"549.755859\" xlink:href=\"#DejaVuSans-114\"/>\n       <use x=\"590.869141\" xlink:href=\"#DejaVuSans-105\"/>\n       <use x=\"618.652344\" xlink:href=\"#DejaVuSans-99\"/>\n       <use x=\"673.632812\" xlink:href=\"#DejaVuSans-97\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_7\">\n     <!-- continent -->\n     <g transform=\"translate(176.986719 316.823537)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-99\"/>\n      <use x=\"54.980469\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"116.162109\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"179.541016\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"218.75\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"246.533203\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"309.912109\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"371.435547\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"434.814453\" xlink:href=\"#DejaVuSans-116\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_7\">\n      <defs>\n       <path d=\"M 0 0 \nL -3.5 0 \n\" id=\"m1a08fd032e\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"33.2875\" xlink:href=\"#m1a08fd032e\" y=\"224.734474\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- 0 -->\n      <defs>\n       <path d=\"M 31.78125 66.40625 \nQ 24.171875 66.40625 20.328125 58.90625 \nQ 16.5 51.421875 16.5 36.375 \nQ 16.5 21.390625 20.328125 13.890625 \nQ 24.171875 6.390625 31.78125 6.390625 \nQ 39.453125 6.390625 43.28125 13.890625 \nQ 47.125 21.390625 47.125 36.375 \nQ 47.125 51.421875 43.28125 58.90625 \nQ 39.453125 66.40625 31.78125 66.40625 \nz\nM 31.78125 74.21875 \nQ 44.046875 74.21875 50.515625 64.515625 \nQ 56.984375 54.828125 56.984375 36.375 \nQ 56.984375 17.96875 50.515625 8.265625 \nQ 44.046875 -1.421875 31.78125 -1.421875 \nQ 19.53125 -1.421875 13.0625 8.265625 \nQ 6.59375 17.96875 6.59375 36.375 \nQ 6.59375 54.828125 13.0625 64.515625 \nQ 19.53125 74.21875 31.78125 74.21875 \nz\n\" id=\"DejaVuSans-48\"/>\n      </defs>\n      <g transform=\"translate(19.925 228.533693)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_8\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"33.2875\" xlink:href=\"#m1a08fd032e\" y=\"198.017567\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 25 -->\n      <defs>\n       <path d=\"M 19.1875 8.296875 \nL 53.609375 8.296875 \nL 53.609375 0 \nL 7.328125 0 \nL 7.328125 8.296875 \nQ 12.9375 14.109375 22.625 23.890625 \nQ 32.328125 33.6875 34.8125 36.53125 \nQ 39.546875 41.84375 41.421875 45.53125 \nQ 43.3125 49.21875 43.3125 52.78125 \nQ 43.3125 58.59375 39.234375 62.25 \nQ 35.15625 65.921875 28.609375 65.921875 \nQ 23.96875 65.921875 18.8125 64.3125 \nQ 13.671875 62.703125 7.8125 59.421875 \nL 7.8125 69.390625 \nQ 13.765625 71.78125 18.9375 73 \nQ 24.125 74.21875 28.421875 74.21875 \nQ 39.75 74.21875 46.484375 68.546875 \nQ 53.21875 62.890625 53.21875 53.421875 \nQ 53.21875 48.921875 51.53125 44.890625 \nQ 49.859375 40.875 45.40625 35.40625 \nQ 44.1875 33.984375 37.640625 27.21875 \nQ 31.109375 20.453125 19.1875 8.296875 \nz\n\" id=\"DejaVuSans-50\"/>\n       <path d=\"M 10.796875 72.90625 \nL 49.515625 72.90625 \nL 49.515625 64.59375 \nL 19.828125 64.59375 \nL 19.828125 46.734375 \nQ 21.96875 47.46875 24.109375 47.828125 \nQ 26.265625 48.1875 28.421875 48.1875 \nQ 40.625 48.1875 47.75 41.5 \nQ 54.890625 34.8125 54.890625 23.390625 \nQ 54.890625 11.625 47.5625 5.09375 \nQ 40.234375 -1.421875 26.90625 -1.421875 \nQ 22.3125 -1.421875 17.546875 -0.640625 \nQ 12.796875 0.140625 7.71875 1.703125 \nL 7.71875 11.625 \nQ 12.109375 9.234375 16.796875 8.0625 \nQ 21.484375 6.890625 26.703125 6.890625 \nQ 35.15625 6.890625 40.078125 11.328125 \nQ 45.015625 15.765625 45.015625 23.390625 \nQ 45.015625 31 40.078125 35.4375 \nQ 35.15625 39.890625 26.703125 39.890625 \nQ 22.75 39.890625 18.8125 39.015625 \nQ 14.890625 38.140625 10.796875 36.28125 \nz\n\" id=\"DejaVuSans-53\"/>\n      </defs>\n      <g transform=\"translate(13.5625 201.816786)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_9\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"33.2875\" xlink:href=\"#m1a08fd032e\" y=\"171.30066\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 50 -->\n      <g transform=\"translate(13.5625 175.099879)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-53\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_10\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"33.2875\" xlink:href=\"#m1a08fd032e\" y=\"144.583753\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 75 -->\n      <defs>\n       <path d=\"M 8.203125 72.90625 \nL 55.078125 72.90625 \nL 55.078125 68.703125 \nL 28.609375 0 \nL 18.3125 0 \nL 43.21875 64.59375 \nL 8.203125 64.59375 \nz\n\" id=\"DejaVuSans-55\"/>\n      </defs>\n      <g transform=\"translate(13.5625 148.382972)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-55\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_11\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"33.2875\" xlink:href=\"#m1a08fd032e\" y=\"117.866847\"/>\n      </g>\n     </g>\n     <g id=\"text_12\">\n      <!-- 100 -->\n      <defs>\n       <path d=\"M 12.40625 8.296875 \nL 28.515625 8.296875 \nL 28.515625 63.921875 \nL 10.984375 60.40625 \nL 10.984375 69.390625 \nL 28.421875 72.90625 \nL 38.28125 72.90625 \nL 38.28125 8.296875 \nL 54.390625 8.296875 \nL 54.390625 0 \nL 12.40625 0 \nz\n\" id=\"DejaVuSans-49\"/>\n      </defs>\n      <g transform=\"translate(7.2 121.666065)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_6\">\n     <g id=\"line2d_12\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"33.2875\" xlink:href=\"#m1a08fd032e\" y=\"91.14994\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 125 -->\n      <g transform=\"translate(7.2 94.949158)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_13\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"33.2875\" xlink:href=\"#m1a08fd032e\" y=\"64.433033\"/>\n      </g>\n     </g>\n     <g id=\"text_14\">\n      <!-- 150 -->\n      <g transform=\"translate(7.2 68.232251)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-53\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_8\">\n     <g id=\"line2d_14\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"33.2875\" xlink:href=\"#m1a08fd032e\" y=\"37.716126\"/>\n      </g>\n     </g>\n     <g id=\"text_15\">\n      <!-- 175 -->\n      <g transform=\"translate(7.2 41.515344)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-55\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_9\">\n     <g id=\"line2d_15\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"33.2875\" xlink:href=\"#m1a08fd032e\" y=\"10.999219\"/>\n      </g>\n     </g>\n     <g id=\"text_16\">\n      <!-- 200 -->\n      <g transform=\"translate(7.2 14.798438)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-50\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n   </g>\n   <g id=\"patch_27\">\n    <path d=\"M 33.2875 224.734474 \nL 33.2875 7.294474 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_28\">\n    <path d=\"M 368.0875 224.734474 \nL 368.0875 7.294474 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_29\">\n    <path d=\"M 33.2875 224.734474 \nL 368.0875 224.734474 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_30\">\n    <path d=\"M 33.2875 7.294474 \nL 368.0875 7.294474 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"legend_1\">\n    <g id=\"patch_31\">\n     <path d=\"M 40.2875 75.119474 \nL 208 75.119474 \nQ 210 75.119474 210 73.119474 \nL 210 14.294474 \nQ 210 12.294474 208 12.294474 \nL 40.2875 12.294474 \nQ 38.2875 12.294474 38.2875 14.294474 \nL 38.2875 73.119474 \nQ 38.2875 75.119474 40.2875 75.119474 \nz\n\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\n    </g>\n    <g id=\"patch_32\">\n     <path d=\"M 42.2875 23.892912 \nL 62.2875 23.892912 \nL 62.2875 16.892912 \nL 42.2875 16.892912 \nz\n\" style=\"fill:#1f77b4;\"/>\n    </g>\n    <g id=\"text_17\">\n     <!-- beer_servings -->\n     <defs>\n      <path d=\"M 48.6875 27.296875 \nQ 48.6875 37.203125 44.609375 42.84375 \nQ 40.53125 48.484375 33.40625 48.484375 \nQ 26.265625 48.484375 22.1875 42.84375 \nQ 18.109375 37.203125 18.109375 27.296875 \nQ 18.109375 17.390625 22.1875 11.75 \nQ 26.265625 6.109375 33.40625 6.109375 \nQ 40.53125 6.109375 44.609375 11.75 \nQ 48.6875 17.390625 48.6875 27.296875 \nz\nM 18.109375 46.390625 \nQ 20.953125 51.265625 25.265625 53.625 \nQ 29.59375 56 35.59375 56 \nQ 45.5625 56 51.78125 48.09375 \nQ 58.015625 40.1875 58.015625 27.296875 \nQ 58.015625 14.40625 51.78125 6.484375 \nQ 45.5625 -1.421875 35.59375 -1.421875 \nQ 29.59375 -1.421875 25.265625 0.953125 \nQ 20.953125 3.328125 18.109375 8.203125 \nL 18.109375 0 \nL 9.078125 0 \nL 9.078125 75.984375 \nL 18.109375 75.984375 \nz\n\" id=\"DejaVuSans-98\"/>\n      <path d=\"M 50.984375 -16.609375 \nL 50.984375 -23.578125 \nL -0.984375 -23.578125 \nL -0.984375 -16.609375 \nz\n\" id=\"DejaVuSans-95\"/>\n      <path d=\"M 2.984375 54.6875 \nL 12.5 54.6875 \nL 29.59375 8.796875 \nL 46.6875 54.6875 \nL 56.203125 54.6875 \nL 35.6875 0 \nL 23.484375 0 \nz\n\" id=\"DejaVuSans-118\"/>\n      <path d=\"M 45.40625 27.984375 \nQ 45.40625 37.75 41.375 43.109375 \nQ 37.359375 48.484375 30.078125 48.484375 \nQ 22.859375 48.484375 18.828125 43.109375 \nQ 14.796875 37.75 14.796875 27.984375 \nQ 14.796875 18.265625 18.828125 12.890625 \nQ 22.859375 7.515625 30.078125 7.515625 \nQ 37.359375 7.515625 41.375 12.890625 \nQ 45.40625 18.265625 45.40625 27.984375 \nz\nM 54.390625 6.78125 \nQ 54.390625 -7.171875 48.1875 -13.984375 \nQ 42 -20.796875 29.203125 -20.796875 \nQ 24.46875 -20.796875 20.265625 -20.09375 \nQ 16.0625 -19.390625 12.109375 -17.921875 \nL 12.109375 -9.1875 \nQ 16.0625 -11.328125 19.921875 -12.34375 \nQ 23.78125 -13.375 27.78125 -13.375 \nQ 36.625 -13.375 41.015625 -8.765625 \nQ 45.40625 -4.15625 45.40625 5.171875 \nL 45.40625 9.625 \nQ 42.625 4.78125 38.28125 2.390625 \nQ 33.9375 0 27.875 0 \nQ 17.828125 0 11.671875 7.65625 \nQ 5.515625 15.328125 5.515625 27.984375 \nQ 5.515625 40.671875 11.671875 48.328125 \nQ 17.828125 56 27.875 56 \nQ 33.9375 56 38.28125 53.609375 \nQ 42.625 51.21875 45.40625 46.390625 \nL 45.40625 54.6875 \nL 54.390625 54.6875 \nz\n\" id=\"DejaVuSans-103\"/>\n     </defs>\n     <g transform=\"translate(70.2875 23.892912)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-98\"/>\n      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"125\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"186.523438\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"227.636719\" xlink:href=\"#DejaVuSans-95\"/>\n      <use x=\"277.636719\" xlink:href=\"#DejaVuSans-115\"/>\n      <use x=\"329.736328\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"391.259766\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"432.373047\" xlink:href=\"#DejaVuSans-118\"/>\n      <use x=\"491.552734\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"519.335938\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"582.714844\" xlink:href=\"#DejaVuSans-103\"/>\n      <use x=\"646.191406\" xlink:href=\"#DejaVuSans-115\"/>\n     </g>\n    </g>\n    <g id=\"patch_33\">\n     <path d=\"M 42.2875 38.849162 \nL 62.2875 38.849162 \nL 62.2875 31.849162 \nL 42.2875 31.849162 \nz\n\" style=\"fill:#ff7f0e;\"/>\n    </g>\n    <g id=\"text_18\">\n     <!-- spirit_servings -->\n     <g transform=\"translate(70.2875 38.849162)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-115\"/>\n      <use x=\"52.099609\" xlink:href=\"#DejaVuSans-112\"/>\n      <use x=\"115.576172\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"143.359375\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"184.472656\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"212.255859\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"251.464844\" xlink:href=\"#DejaVuSans-95\"/>\n      <use x=\"301.464844\" xlink:href=\"#DejaVuSans-115\"/>\n      <use x=\"353.564453\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"415.087891\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"456.201172\" xlink:href=\"#DejaVuSans-118\"/>\n      <use x=\"515.380859\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"543.164062\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"606.542969\" xlink:href=\"#DejaVuSans-103\"/>\n      <use x=\"670.019531\" xlink:href=\"#DejaVuSans-115\"/>\n     </g>\n    </g>\n    <g id=\"patch_34\">\n     <path d=\"M 42.2875 53.805412 \nL 62.2875 53.805412 \nL 62.2875 46.805412 \nL 42.2875 46.805412 \nz\n\" style=\"fill:#2ca02c;\"/>\n    </g>\n    <g id=\"text_19\">\n     <!-- wine_servings -->\n     <defs>\n      <path d=\"M 4.203125 54.6875 \nL 13.1875 54.6875 \nL 24.421875 12.015625 \nL 35.59375 54.6875 \nL 46.1875 54.6875 \nL 57.421875 12.015625 \nL 68.609375 54.6875 \nL 77.59375 54.6875 \nL 63.28125 0 \nL 52.6875 0 \nL 40.921875 44.828125 \nL 29.109375 0 \nL 18.5 0 \nz\n\" id=\"DejaVuSans-119\"/>\n     </defs>\n     <g transform=\"translate(70.2875 53.805412)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-119\"/>\n      <use x=\"81.787109\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"109.570312\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"172.949219\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"234.472656\" xlink:href=\"#DejaVuSans-95\"/>\n      <use x=\"284.472656\" xlink:href=\"#DejaVuSans-115\"/>\n      <use x=\"336.572266\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"398.095703\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"439.208984\" xlink:href=\"#DejaVuSans-118\"/>\n      <use x=\"498.388672\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"526.171875\" xlink:href=\"#DejaVuSans-110\"/>\n      <use x=\"589.550781\" xlink:href=\"#DejaVuSans-103\"/>\n      <use x=\"653.027344\" xlink:href=\"#DejaVuSans-115\"/>\n     </g>\n    </g>\n    <g id=\"patch_35\">\n     <path d=\"M 42.2875 68.761662 \nL 62.2875 68.761662 \nL 62.2875 61.761662 \nL 42.2875 61.761662 \nz\n\" style=\"fill:#d62728;\"/>\n    </g>\n    <g id=\"text_20\">\n     <!-- total_litres_of_pure_alcohol -->\n     <defs>\n      <path d=\"M 9.421875 75.984375 \nL 18.40625 75.984375 \nL 18.40625 0 \nL 9.421875 0 \nz\n\" id=\"DejaVuSans-108\"/>\n     </defs>\n     <g transform=\"translate(70.2875 68.761662)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"39.208984\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"100.390625\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"139.599609\" xlink:href=\"#DejaVuSans-97\"/>\n      <use x=\"200.878906\" xlink:href=\"#DejaVuSans-108\"/>\n      <use x=\"228.662109\" xlink:href=\"#DejaVuSans-95\"/>\n      <use x=\"278.662109\" xlink:href=\"#DejaVuSans-108\"/>\n      <use x=\"306.445312\" xlink:href=\"#DejaVuSans-105\"/>\n      <use x=\"334.228516\" xlink:href=\"#DejaVuSans-116\"/>\n      <use x=\"373.4375\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"412.300781\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"473.824219\" xlink:href=\"#DejaVuSans-115\"/>\n      <use x=\"525.923828\" xlink:href=\"#DejaVuSans-95\"/>\n      <use x=\"575.923828\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"637.105469\" xlink:href=\"#DejaVuSans-102\"/>\n      <use x=\"672.310547\" xlink:href=\"#DejaVuSans-95\"/>\n      <use x=\"722.310547\" xlink:href=\"#DejaVuSans-112\"/>\n      <use x=\"785.787109\" xlink:href=\"#DejaVuSans-117\"/>\n      <use x=\"849.166016\" xlink:href=\"#DejaVuSans-114\"/>\n      <use x=\"888.029297\" xlink:href=\"#DejaVuSans-101\"/>\n      <use x=\"949.552734\" xlink:href=\"#DejaVuSans-95\"/>\n      <use x=\"999.552734\" xlink:href=\"#DejaVuSans-97\"/>\n      <use x=\"1060.832031\" xlink:href=\"#DejaVuSans-108\"/>\n      <use x=\"1088.615234\" xlink:href=\"#DejaVuSans-99\"/>\n      <use x=\"1143.595703\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"1204.777344\" xlink:href=\"#DejaVuSans-104\"/>\n      <use x=\"1268.15625\" xlink:href=\"#DejaVuSans-111\"/>\n      <use x=\"1329.337891\" xlink:href=\"#DejaVuSans-108\"/>\n     </g>\n    </g>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p95d6e00bdf\">\n   <rect height=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TNnzgRiNzqXLFlS7OOsXbuW1q1bM3r0aNq3b8/q1avp1asXkydPZvv27QB89dVXbNq0KeH2559/PrNmzWLatGkJu2QK0qxZMz799FOysrKAWJdOYTGJSMVQYa7cizN0sSw0b96cqVOncsUVV9CkSROuueYaevXqxbXXXkt2djY5OTlcf/31tGzZkqeffpo//OEP/OUvf2HXrl0MHDiQNm3aFOs49913H3PnzqVy5cq0aNGCs846i2rVqrFq1So6deoExG6O/vOf/0zYvXPooYfSokULVq5cSYcOxa+wXKNGDR555BF69+5N/fr199g2UUwiUjEUOVlHeUg0WceqVato3rx5SBEdWLZv307NmjVxd6666iqaNGnCyJEjy/y4URrnrp9XCUOpJuuQ6HvsscdIT0+nZcuWZGdn79PHLyIVT4XplomKJ554gvvvv3+Pts6dO/Pwww+HFBGMHDmyXK7URaT8KLmXs2HDhjFs2LCwwxCRiFO3jIhIBCm5i4hEkJK7iEgEKbmLiERQxbmhOrZOkveXndTdTZw4kYMPPphLLrmk0GVTpkyhZ8+eHH300Uk9flFmz57NypUrGTNmTLkeV0TCUZwJsicDfYBN7t4qaJsOnBisUhfY6u7pZtYIWAV8FCx7192vTHbQqejKKxN/zJycnD2WTZkyhVatWpVJcs/JyaFKlcSntG/fvvTt2zfpxxSR1FScK/cpwEPAk3kN7p5fvMTM7gHiL4PXunt6sgIM0w8//MCFF17IunXr2L17N7fccgujR4/moosuYu7cuQA888wz/PrXv2bs2LHUrFmTG264ge7du3Pqqafy9ttv07dvX7Zt20bNmjVp1KgRixcvZvDgwdSoUYN33nknYRndMWPGMHv2bKpUqULPnj2ZMGECmzdv5sorr+SLL74AYqUBOnfuzNixY1m/fj1ZWVnUr1+ftWvXMnnyZFq2bAlA9+7dueeee1i2bBmLFy/moYceYujQodSuXZvFixfz9ddfM378ePr3709ubi5XX3018+bNo3HjxuTm5nLZZZfRv3//hDGJSOoqzgTZ84Mr8n1YrPTghcAZyQ0rNfznP//h6KOP5uWXY1P8ZWdnM3r0aGrXrs2iRYt48sknuf766/nXv/61z7Zbt25l3rx5AIwdOxaA/v3789BDDzFhwgTat0/4xDDffvstL774IqtXr8bM2Lo19oj+ddddx8iRIznttNP44osv6NWrF6tWrQIgIyODBQsWUKNGDe69915mzJjBbbfdxoYNG1i/fj3t2rVj2bJlexxnw4YNLFiwgNWrV9O3b1/69+/PCy+8QFZWFsuWLWPTpk00b96cyy67rMCYRCR1lbbPvQuw0d3XxLU1NrMPge+B/3X3t0p5jNC0bt2aG264gdGjR9OnTx+6dOkCxGqe530v6MnO/anMGK927dpUr16d3//+95xzzjn5syK9/vrrrFy5Mn+977//Pn9mpL59++b/BXDhhRdy5plncttttzFjxow96svHO++886hUqRItWrRg48aNACxYsIABAwZQqVIljjzySE4//fRCYxKJqsLmbA6riOH+Ku1omUHAtLj3G4Dj3L0t8EfgGTOrnWhDMxtuZovNbHH87D+ppGnTpmRkZNC6dWtuvPFGbr/9dmDPGu+J6qZD0fXbC1KlShUWLVrEBRdcwKxZs+jduzcAubm5vPPOO2RmZpKZmclXX31FrVq19jnWMcccQ7169Vi6dCnTp09n4MCBCY8TX9s9r3hcQUXkCopJRFJXiZO7mVUBzgfyC4C7+0533xK8zgDWAk0Tbe/uk9y9vbu3b9CgQUnDKFPr16/n4IMPZsiQIdxwww188MEHwC81z6dPn55fjre4atWqVehcpNu3byc7O5uzzz6b++67L3/yj549e/LQQw/lr1fQpCAAAwcOZPz48WRnZ9O6detix3baaafx/PPPk5uby8aNG3nzzTcLjUlEUldpumV+A6x293V5DWbWAPjW3Xeb2QlAE+DTUsYYk+Shi8WxbNkyRo0aRaVKlahatSqPPvoo/fv3Z+fOnZxyyink5uYybdq0oncUZ+jQoVx55ZUF3lDdtm0b5557Ljt27MDduffeewF44IEHuOqqq0hLSyMnJ4euXbsyceLEhMfo378/1113Hbfccst+xXbBBRfwxhtv0KpVK5o2bcopp5xCnTp1CoxJRFJXkfXczWwa0B2oD2wEbnX3x81sCrGhjhPj1r0AuB3IAXYH6/5fUUFUpHrueSNe6tevH3YoZSKvtvuWLVvo0KEDb7/9NkceeWSZHEv13CVVVZQ+98LquRdntMygAtqHJmh7Hnh+fwOU1NGnTx+2bt3Kzz//zC233FJmiV1EylbFeUI1ReTNNZoM/fr147PPPtuj7e6776ZXr15JO8b+yutnF5GKTck9RC+++GLYIYhIRKlwmIhIBCm5i4hEkLplRMJQWJXTEIb9SvToyl1EJIIqzJV766nFf9KyOJZduqzolYpw9tln88wzz1C3buqOyV6/fj3XXnstzz33XNihiEg5qjDJPRW98sorYYcAwO7du6lcuXLCZUcffbQSu8gBSN0yhRg/fjwPPPAAACNHjuSMM2KVjd944w2GDBlCo0aN+Oabb8jKyqJ58+ZcfvnltGzZkp49e/LTTz8BsHbtWnr37k27du3o0qULq1evLvB4M2fOpFWrVrRp04auXbsCscQ9atQoTj75ZNLS0vj73/8OxMajn3766Vx88cW0bt2a0aNH88gjj+Tva+zYsdxzzz1kZWXRqlUrIDZRyPnnn0/v3r1p0qQJf/rTn/LXf/zxx2natCndu3fn8ssv5+qrry4wJhFJfUruhejatStvvRWrWLx48WK2b9/Orl27WLBgQX753zxr1qzhqquuYsWKFdStW5fnn489qDt8+HAefPBBMjIymDBhAiNGjCjweLfffjuvvvoqS5YsYfbs2UAs6dapU4f333+f999/n8ceeyz/wadFixZx5513snLlSgYOHJhf0AwosNxvZmYm06dPZ9myZUyfPp0vv/yS9evXc8cdd/Duu+/y2muv7fELKFFMIpL6lNwL0a5dOzIyMti2bRvVqlWjU6dOLF68mLfeemuf5N64cWPS09Pzt8vKymL79u0sXLiQAQMGkJ6ezhVXXMGGDRsKPF7nzp0ZOnQojz32GLt37wZgzpw5PPnkk6Snp3PKKaewZcsW1qyJlc/v0KEDjRs3BqBt27Zs2rSJ9evXs2TJEg499FCOO+64fY7Ro0cP6tSpQ/Xq1WnRogWff/45ixYtolu3bhx22GFUrVp1j18KiWISkdSnPvdCVK1alUaNGvHEE09w6qmnkpaWxty5c1m7du0+RaLi66NXrlyZn376idzcXOrWrVvsErkTJ07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3AtMMzMlgK/JdYPX5ilQE5wA3RkMY+7EvhfYE5wnNeI9ecX5llglJl9qBuqUlZUfkBEJIJ05S4iEkFK7iIiEaTkLiISQUruIiIRpOQuIhJBSu4iIhGk5C4iEkFK7iIiEfT/A+As6FL4eBUsAAAAAElFTkSuQmCC\n"
     },
     "metadata": {
      "needs_background": "light"
     }
    }
   ],
   "source": [
    "drinks.groupby('continent').mean().plot(kind='bar')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "## Miscellaneous\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# replace all of the column names by overwriting the 'columns' attribute\n",
    "\n",
    "ufo_cols = ['city', 'colors_reported', 'shape_reported', 'state', 'time','Location']\n",
    "ufo.columns = ufo_cols\n",
    "ufo.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# replace all spaces with underscores in the column names by using the 'str.replace' method\n",
    "\n",
    "ufo.columns = ufo.columns.str.replace(' ', '_')\n",
    "ufo.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# replace the column names during the file reading process by using the 'names' parameter\n",
    "\n",
    "ufo = pd.read_csv('ufo.csv', header=0, names=ufo_cols)\n",
    "ufo.columns"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## For detailed documentation (https://pandas.pydata.org/pandas-docs/stable/reference/index.html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2-final"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}